From: Paul Brossier Date: Sun, 4 Oct 2009 22:30:32 +0000 (+0200) Subject: src/temporal/{a,c}_weighting.{c,h}: set_a,c_weighting return 1 on error, 0 on success X-Git-Tag: bzr2git~215 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f530f121d2e4bed03160556e8d8710044c812d9b;p=aubio.git src/temporal/{a,c}_weighting.{c,h}: set_a,c_weighting return 1 on error, 0 on success --- diff --git a/src/temporal/a_weighting.c b/src/temporal/a_weighting.c index 0a7f92fb..869f519c 100644 --- a/src/temporal/a_weighting.c +++ b/src/temporal/a_weighting.c @@ -26,7 +26,7 @@ #include "temporal/filter.h" #include "temporal/a_weighting.h" -void aubio_filter_set_a_weighting (aubio_filter_t * f) { +uint_t aubio_filter_set_a_weighting (aubio_filter_t * f) { uint_t samplerate = aubio_filter_get_samplerate (f); lvec_t *bs = aubio_filter_get_feedforward (f); @@ -36,7 +36,7 @@ void aubio_filter_set_a_weighting (aubio_filter_t * f) { if ( order != 7 ) { AUBIO_ERROR ( "order of A-weighting filter must be 7, not %d\n", order ); - return; + return 1; } /* select coefficients according to sampling frequency */ @@ -244,10 +244,11 @@ void aubio_filter_set_a_weighting (aubio_filter_t * f) { AUBIO_ERROR ( "sampling rate of A-weighting filter is %d, should be one of\ 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, 192000.\n", samplerate ); - break; + return 1; } + return 0; } aubio_filter_t * new_aubio_filter_a_weighting (uint_t samplerate, uint_t channels) { diff --git a/src/temporal/a_weighting.h b/src/temporal/a_weighting.h index 917e2db0..26d4af86 100644 --- a/src/temporal/a_weighting.h +++ b/src/temporal/a_weighting.h @@ -75,7 +75,7 @@ aubio_filter_t * new_aubio_filter_a_weighting (uint_t samplerate, uint_t channel \param f filter object to get coefficients from */ -void aubio_filter_set_a_weighting (aubio_filter_t *f); +uint_t aubio_filter_set_a_weighting (aubio_filter_t *f); #ifdef __cplusplus } diff --git a/src/temporal/c_weighting.c b/src/temporal/c_weighting.c index 00b12837..485a1497 100644 --- a/src/temporal/c_weighting.c +++ b/src/temporal/c_weighting.c @@ -25,7 +25,7 @@ #include "temporal/filter.h" #include "temporal/c_weighting.h" -void aubio_filter_set_c_weighting (aubio_filter_t * f) { +uint_t aubio_filter_set_c_weighting (aubio_filter_t * f) { uint_t samplerate = aubio_filter_get_samplerate (f); lvec_t * bs = aubio_filter_get_feedforward (f); @@ -35,7 +35,7 @@ void aubio_filter_set_c_weighting (aubio_filter_t * f) { if ( order != 5 ) { AUBIO_ERROR ( "order of C-weighting filter must be 5, not %d\n", order ); - return; + return 1; } /* select coefficients according to sampling frequency */ @@ -199,10 +199,11 @@ void aubio_filter_set_c_weighting (aubio_filter_t * f) { AUBIO_ERROR ( "sampling rate of C-weighting filter is %d, should be one of\ 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, 192000.\n", samplerate ); - break; + return 1; } + return 0; } aubio_filter_t * new_aubio_filter_c_weighting (uint_t samplerate, uint_t channels) { diff --git a/src/temporal/c_weighting.h b/src/temporal/c_weighting.h index 9a92a960..2caf872e 100644 --- a/src/temporal/c_weighting.h +++ b/src/temporal/c_weighting.h @@ -75,7 +75,7 @@ aubio_filter_t * new_aubio_filter_c_weighting (uint_t samplerate, uint_t channel \param f filter object to get coefficients from */ -void aubio_filter_set_c_weighting (aubio_filter_t *f); +uint_t aubio_filter_set_c_weighting (aubio_filter_t *f); #ifdef __cplusplus }