aboutsummaryrefslogtreecommitdiff
path: root/src/iem_tab.c
blob: 479ed5576ca1a1e5397e9e706ccdd565f8699502 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.

iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2011 */

#include "m_pd.h"
#include "iemlib.h"

int iem_tab_check_arrays(t_symbol *obj_name, t_symbol *array_name, iemarray_t **beg_mem, int *array_size, int max_index)
{
  int ok=1;
  t_garray *a;
  
  if(!(a = (t_garray *)pd_findbyclass(array_name, garray_class)))
  {
    error("%s: no such array", array_name->s_name);
    ok = 0;
  }
  else if(!iemarray_getarray(a, array_size, beg_mem))
  {
    error("%s: bad template for %s", array_name->s_name, obj_name->s_name);
    ok = 0;
  }
  else if(*array_size < max_index)
  {
    error("%s: bad array-size: %d", array_name->s_name, *array_size);
    ok = 0;
  }
  return(ok);
}


// Georg Holzmann:
#ifdef IEMTAB_SINGLE_OBJ
// for single externals disable the iem_tab object
#else
// build as library

static t_class *iem_tab_class;

static void *iem_tab_new(void)
{
  t_object *x = (t_object *)pd_new(iem_tab_class);
  
  return (x);
}

void tab_abs_setup(void);
void tab_add_setup(void);
void tab_add_scalar_setup(void);
void tab_carth2polar_setup(void);
void tab_complex_inv_setup(void);
void tab_complex_mul_setup(void);
void tab_const_setup(void);
void tab_conv_setup(void);
void tab_copy_setup(void);
void tab_counter_setup(void);
void tab_cross_corr_setup(void);
void tab_dbtopow_setup(void);
void tab_dbtorms_setup(void);
void tab_div_setup(void);
void tab_eq_setup(void);
void tab_eq_scalar_setup(void);
void tab_fft_setup(void);
void tab_find_exact_peaks_setup(void);
void tab_find_peaks_setup(void);
void tab_ge_setup(void);
void tab_ge_scalar_setup(void);
void tab_get_size_setup(void);
void tab_gt_setup(void);
void tab_gt_scalar_setup(void);
void tab_ifft_setup(void);
void tab_le_setup(void);
void tab_le_scalar_setup(void);
void tab_lt_setup(void);
void tab_lt_scalar_setup(void);
void tab_max_index_setup(void);
void tab_min_index_setup(void);
void tab_min_max_setup(void);
void tab_mul_setup(void);
void tab_mul_scalar_setup(void);
void tab_ne_setup(void);
void tab_ne_scalar_setup(void);
void tab_powtodb_setup(void);
void tab_reverse_setup(void);
void tab_rfft_setup(void);
void tab_rifft_setup(void);
void tab_rmstodb_setup(void);
void tab_sqrt_setup(void);
void tab_sub_setup(void);
void tab_sum_setup(void);

/* ------------------------ setup routine ------------------------- */

void iem_tab_setup(void)
{
  iem_tab_class = class_new(gensym("iem_tab"), iem_tab_new, 0,
    sizeof(t_object), CLASS_NOINLET, 0);
  
  tab_abs_setup();
  tab_add_setup();
  tab_add_scalar_setup();
  tab_carth2polar_setup();
  tab_complex_inv_setup();
  tab_complex_mul_setup();
  tab_const_setup();
  tab_conv_setup();
  tab_copy_setup();
  tab_counter_setup();
  tab_cross_corr_setup();
  tab_dbtopow_setup();
  tab_dbtorms_setup();
  tab_div_setup();
  tab_eq_setup();
  tab_eq_scalar_setup();
  tab_fft_setup();
  tab_find_exact_peaks_setup();
  tab_find_peaks_setup();
  tab_ge_setup();
  tab_ge_scalar_setup();
  tab_gt_setup();
  tab_gt_scalar_setup();
  tab_get_size_setup();
  tab_ifft_setup();
  tab_le_setup();
  tab_le_scalar_setup();
  tab_lt_setup();
  tab_lt_scalar_setup();
  tab_max_index_setup();
  tab_min_index_setup();
  tab_min_max_setup();
  tab_mul_setup();
  tab_mul_scalar_setup();
  tab_ne_setup();
  tab_ne_scalar_setup();
  tab_powtodb_setup();
  tab_reverse_setup();
  tab_rfft_setup();
  tab_rifft_setup();
  tab_rmstodb_setup();
  tab_sqrt_setup();
  tab_sub_setup();
  tab_sum_setup();
  
  post("iem_tab (R-1.20) library loaded!   (c) Thomas Musil 11.2011");
  post("   musil%ciem.at iem KUG Graz Austria", '@');
}

#endif // library