Changeset 1103:bb5ee2384821 in roaraudio


Ignore:
Timestamp:
01/11/09 02:12:30 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

disable options needing libm

Location:
roarclients
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarfctest.c

    r956 r1103  
    2323 */ 
    2424 
     25#include <roaraudio.h>  /* libroar */ 
     26 
     27#ifdef ROAR_HAVE_LIBM 
     28 
    2529#include <math.h>       /* sin() */ 
    2630#include <stdio.h>      /* *printf*() */ 
    27 #include <roaraudio.h>  /* libroar */ 
    2831#include <libroardsp/libroardsp.h> 
    2932 
     
    131134} 
    132135 
     136#else 
     137int main (void) { 
     138 fprintf(stderr, "Error: No Math library support compiled in.\n"); 
     139 return 1; 
     140} 
     141#endif 
     142 
    133143//ll 
  • roarclients/roarfilt.c

    r1005 r1103  
    2525#include <roaraudio.h> 
    2626#include <libroardsp/libroardsp.h> 
     27 
     28#ifdef ROAR_HAVE_LIBM 
    2729#include <math.h> 
     30#endif 
    2831 
    2932#define BUFSIZE 1024 
     33#ifdef ROAR_HAVE_LIBM 
    3034struct { 
    3135 uint16_t a, b; 
    3236 int16_t  old[ROAR_MAX_CHANNELS]; 
    3337} g_lowpass; 
     38#endif 
    3439 
    3540void usage (void) { 
     
    4954        "  --mul VAL          - Set mul\n" 
    5055        "  --div VAL          - Set div\n" 
     56#ifdef ROAR_HAVE_LIBM 
    5157        "  --lowpass freq     - lowpass filter\n" 
     58#endif 
    5259        "  --filter  name     - add filter name\n" 
    5360        "  --ffreq   freq     - set filter freq\n" 
     
    8087} 
    8188 
     89#ifdef ROAR_HAVE_LIBM 
    8290void logs2 (void * data, float scale, int len) { 
    8391 int16_t * samples = (int16_t *) data; 
     
    126134 } 
    127135} 
     136#endif 
    128137 
    129138int main (int argc, char * argv[]) { 
     
    146155 struct roar_stream         stream; 
    147156 
     157#ifdef ROAR_HAVE_LIBM 
    148158 memset(&g_lowpass, 0, sizeof(g_lowpass)); 
     159#endif 
    149160 
    150161 roardsp_fchain_init(&fc); 
     
    173184  } else if ( strcmp(k, "--log") == 0 ) { 
    174185   logscale = atof(argv[++i]); 
     186#ifdef ROAR_HAVE_LIBM 
    175187  } else if ( strcmp(k, "--lowpass") == 0 ) { 
    176188   lp = exp(-2 * M_PI * atof(argv[++i]) / rate) * 65536; 
    177189   g_lowpass.b = lp; 
    178190   g_lowpass.a = 65536 - lp; 
     191#endif 
    179192//   printf("lowpass: A=%i, B=%i\n", g_lowpass.a, g_lowpass.b); 
    180193  } else if ( strcmp(k, "--filter") == 0 ) { 
     
    221234 } 
    222235 
    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 ) { 
    224241  fprintf(stderr, "Error: filter is useless!\n"); 
    225242  return 0; 
     
    230247   if ( mul != div ) 
    231248    vol2((void*)buf, mul, div, i); 
     249#ifdef ROAR_HAVE_LIBM 
    232250   if ( logscale ) 
    233251    logs2((void*)buf, logscale, i); 
    234252   if ( g_lowpass.a ) 
    235253    lowpass2((void*)buf, i, channels); 
     254#endif 
    236255   roardsp_fchain_calc(&fc, (void*)buf, (8*i)/bits); 
    237256   if (write(fh, buf, i) != i) 
  • roarclients/roarsin.c

    r888 r1103  
    2323 */ 
    2424 
     25#include <roaraudio.h>  /* libroar */ 
     26 
     27#ifdef ROAR_HAVE_LIBM 
     28 
    2529#include <math.h>       /* sin() */ 
    2630#include <stdio.h>      /* *printf*() */ 
    27 #include <roaraudio.h>  /* libroar */ 
    2831 
    2932double rect (double x) { 
     
    123126} 
    124127 
     128#else 
     129int main (void) { 
     130 fprintf(stderr, "Error: No Math library support compiled in.\n"); 
     131 return 1; 
     132} 
     133#endif 
     134 
    125135//ll 
  • roarclients/roarvumeter.c

    r669 r1103  
    2424 
    2525#include <roaraudio.h> 
     26 
     27#ifdef ROAR_HAVE_LIBM 
     28 
    2629#include <math.h> 
    2730 
     
    135138} 
    136139 
     140#else 
     141int main (void) { 
     142 fprintf(stderr, "Error: No Math library support compiled in.\n"); 
     143 return 1; 
     144} 
     145#endif 
     146 
    137147//ll 
Note: See TracChangeset for help on using the changeset viewer.