From: Paul Brossier Date: Thu, 15 Oct 2009 16:49:47 +0000 (+0200) Subject: src/onset/onsetdetection.c: add 'default' method, set it to hfc, set method to defaul... X-Git-Tag: bzr2git~132 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cd77c150fae93e50164a354587589c231b3f4ddc;p=aubio.git src/onset/onsetdetection.c: add 'default' method, set it to hfc, set method to default when parsing the string fails --- diff --git a/src/onset/onsetdetection.c b/src/onset/onsetdetection.c index d15e7e26..f88a24f6 100644 --- a/src/onset/onsetdetection.c +++ b/src/onset/onsetdetection.c @@ -133,6 +133,7 @@ typedef enum { aubio_onset_kl, /**< Kullback Liebler */ aubio_onset_mkl, /**< modified Kullback Liebler */ aubio_onset_specflux, /**< spectral flux */ + aubio_onset_default = aubio_onset_hfc, /**< default mode, set to hfc */ } aubio_onsetdetection_type; /** structure to store object state */ @@ -339,9 +340,11 @@ new_aubio_onsetdetection (char_t * onset_mode, onset_type = aubio_onset_kl; else if (strcmp (onset_mode, "specflux") == 0) onset_type = aubio_onset_specflux; + else if (strcmp (onset_mode, "default") == 0) + onset_type = aubio_onset_default; else { AUBIO_ERR("unknown onset type.\n"); - return NULL; + onset_type = aubio_onset_default; } switch(onset_type) { /* for both energy and hfc, only fftgrain->norm is required */