Changeset 1103:bb5ee2384821 in roaraudio
- Timestamp:
- 01/11/09 02:12:30 (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roarclients
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarfctest.c
r956 r1103 23 23 */ 24 24 25 #include <roaraudio.h> /* libroar */ 26 27 #ifdef ROAR_HAVE_LIBM 28 25 29 #include <math.h> /* sin() */ 26 30 #include <stdio.h> /* *printf*() */ 27 #include <roaraudio.h> /* libroar */28 31 #include <libroardsp/libroardsp.h> 29 32 … … 131 134 } 132 135 136 #else 137 int main (void) { 138 fprintf(stderr, "Error: No Math library support compiled in.\n"); 139 return 1; 140 } 141 #endif 142 133 143 //ll -
roarclients/roarfilt.c
r1005 r1103 25 25 #include <roaraudio.h> 26 26 #include <libroardsp/libroardsp.h> 27 28 #ifdef ROAR_HAVE_LIBM 27 29 #include <math.h> 30 #endif 28 31 29 32 #define BUFSIZE 1024 33 #ifdef ROAR_HAVE_LIBM 30 34 struct { 31 35 uint16_t a, b; 32 36 int16_t old[ROAR_MAX_CHANNELS]; 33 37 } g_lowpass; 38 #endif 34 39 35 40 void usage (void) { … … 49 54 " --mul VAL - Set mul\n" 50 55 " --div VAL - Set div\n" 56 #ifdef ROAR_HAVE_LIBM 51 57 " --lowpass freq - lowpass filter\n" 58 #endif 52 59 " --filter name - add filter name\n" 53 60 " --ffreq freq - set filter freq\n" … … 80 87 } 81 88 89 #ifdef ROAR_HAVE_LIBM 82 90 void logs2 (void * data, float scale, int len) { 83 91 int16_t * samples = (int16_t *) data; … … 126 134 } 127 135 } 136 #endif 128 137 129 138 int main (int argc, char * argv[]) { … … 146 155 struct roar_stream stream; 147 156 157 #ifdef ROAR_HAVE_LIBM 148 158 memset(&g_lowpass, 0, sizeof(g_lowpass)); 159 #endif 149 160 150 161 roardsp_fchain_init(&fc); … … 173 184 } else if ( strcmp(k, "--log") == 0 ) { 174 185 logscale = atof(argv[++i]); 186 #ifdef ROAR_HAVE_LIBM 175 187 } else if ( strcmp(k, "--lowpass") == 0 ) { 176 188 lp = exp(-2 * M_PI * atof(argv[++i]) / rate) * 65536; 177 189 g_lowpass.b = lp; 178 190 g_lowpass.a = 65536 - lp; 191 #endif 179 192 // printf("lowpass: A=%i, B=%i\n", g_lowpass.a, g_lowpass.b); 180 193 } else if ( strcmp(k, "--filter") == 0 ) { … … 221 234 } 222 235 223 if ( mul == div && logscale == 0 && g_lowpass.a == 0 && roardsp_fchain_num(&fc) == 0 ) { 236 if ( mul == div && 237 #ifdef ROAR_HAVE_LIBM 238 logscale == 0 && g_lowpass.a == 0 && 239 #endif 240 roardsp_fchain_num(&fc) == 0 ) { 224 241 fprintf(stderr, "Error: filter is useless!\n"); 225 242 return 0; … … 230 247 if ( mul != div ) 231 248 vol2((void*)buf, mul, div, i); 249 #ifdef ROAR_HAVE_LIBM 232 250 if ( logscale ) 233 251 logs2((void*)buf, logscale, i); 234 252 if ( g_lowpass.a ) 235 253 lowpass2((void*)buf, i, channels); 254 #endif 236 255 roardsp_fchain_calc(&fc, (void*)buf, (8*i)/bits); 237 256 if (write(fh, buf, i) != i) -
roarclients/roarsin.c
r888 r1103 23 23 */ 24 24 25 #include <roaraudio.h> /* libroar */ 26 27 #ifdef ROAR_HAVE_LIBM 28 25 29 #include <math.h> /* sin() */ 26 30 #include <stdio.h> /* *printf*() */ 27 #include <roaraudio.h> /* libroar */28 31 29 32 double rect (double x) { … … 123 126 } 124 127 128 #else 129 int main (void) { 130 fprintf(stderr, "Error: No Math library support compiled in.\n"); 131 return 1; 132 } 133 #endif 134 125 135 //ll -
roarclients/roarvumeter.c
r669 r1103 24 24 25 25 #include <roaraudio.h> 26 27 #ifdef ROAR_HAVE_LIBM 28 26 29 #include <math.h> 27 30 … … 135 138 } 136 139 140 #else 141 int main (void) { 142 fprintf(stderr, "Error: No Math library support compiled in.\n"); 143 return 1; 144 } 145 #endif 146 137 147 //ll
Note: See TracChangeset
for help on using the changeset viewer.