ref: 69f74f001cc87e957b49aedec8ccd71a944f18bd
parent: 55d1fa4a8e6a7dac222190203dd6937a1ee2341c
author: Paul Brossier <piem@piem.org>
date: Thu Apr 21 15:09:47 EDT 2016
src/tempo/: add const qualifiers
--- a/src/tempo/beattracking.c
+++ b/src/tempo/beattracking.c
@@ -123,7 +123,7 @@
void
-aubio_beattracking_do (aubio_beattracking_t * bt, fvec_t * dfframe,
+aubio_beattracking_do (aubio_beattracking_t * bt, const fvec_t * dfframe,
fvec_t * output)
{
@@ -409,19 +409,19 @@
}
smpl_t
-aubio_beattracking_get_period (aubio_beattracking_t * bt)
+aubio_beattracking_get_period (const aubio_beattracking_t * bt)
{
return bt->hop_size * bt->bp;
}
smpl_t
-aubio_beattracking_get_period_s (aubio_beattracking_t * bt)
+aubio_beattracking_get_period_s (const aubio_beattracking_t * bt)
{
return aubio_beattracking_get_period(bt) / (smpl_t) bt->samplerate;
}
smpl_t
-aubio_beattracking_get_bpm (aubio_beattracking_t * bt)
+aubio_beattracking_get_bpm (const aubio_beattracking_t * bt)
{
if (bt->bp != 0) {
return 60. / aubio_beattracking_get_period_s(bt);
@@ -431,7 +431,7 @@
}
smpl_t
-aubio_beattracking_get_confidence (aubio_beattracking_t * bt)
+aubio_beattracking_get_confidence (const aubio_beattracking_t * bt)
{
if (bt->gp) {
smpl_t acf_sum = fvec_sum(bt->acfout);
--- a/src/tempo/beattracking.h
+++ b/src/tempo/beattracking.h
@@ -64,7 +64,7 @@
\param out stored detected beat locations
*/
-void aubio_beattracking_do (aubio_beattracking_t * bt, fvec_t * dfframes,
+void aubio_beattracking_do (aubio_beattracking_t * bt, const fvec_t * dfframes,
fvec_t * out);
/** get current beat period in samples
@@ -75,7 +75,7 @@
value is found.
*/
-smpl_t aubio_beattracking_get_period (aubio_beattracking_t * bt);
+smpl_t aubio_beattracking_get_period (const aubio_beattracking_t * bt);
/** get current beat period in seconds
@@ -85,7 +85,7 @@
value is found.
*/
-smpl_t aubio_beattracking_get_period_s (aubio_beattracking_t * bt);
+smpl_t aubio_beattracking_get_period_s (const aubio_beattracking_t * bt);
/** get current tempo in bpm
@@ -95,7 +95,7 @@
consistent value is found.
*/
-smpl_t aubio_beattracking_get_bpm(aubio_beattracking_t * bt);
+smpl_t aubio_beattracking_get_bpm(const aubio_beattracking_t * bt);
/** get current tempo confidence
@@ -105,7 +105,7 @@
consistent value is found.
*/
-smpl_t aubio_beattracking_get_confidence(aubio_beattracking_t * bt);
+smpl_t aubio_beattracking_get_confidence(const aubio_beattracking_t * bt);
/** delete beat tracking object
--- a/src/tempo/tempo.c
+++ b/src/tempo/tempo.c
@@ -54,7 +54,7 @@
};
/* execute tempo detection function on iput buffer */
-void aubio_tempo_do(aubio_tempo_t *o, fvec_t * input, fvec_t * tempo)
+void aubio_tempo_do(aubio_tempo_t *o, const fvec_t * input, fvec_t * tempo)
{
uint_t i;
uint_t winlen = o->winlen;
@@ -163,7 +163,7 @@
}
/* Allocate memory for an tempo detection */
-aubio_tempo_t * new_aubio_tempo (char_t * tempo_mode,
+aubio_tempo_t * new_aubio_tempo (const char_t * tempo_mode,
uint_t buf_size, uint_t hop_size, uint_t samplerate)
{
aubio_tempo_t * o = AUBIO_NEW(aubio_tempo_t);
--- a/src/tempo/tempo.h
+++ b/src/tempo/tempo.h
@@ -50,7 +50,7 @@
\return newly created ::aubio_tempo_t if successful, `NULL` otherwise
*/
-aubio_tempo_t * new_aubio_tempo (char_t * method,
+aubio_tempo_t * new_aubio_tempo (const char_t * method,
uint_t buf_size, uint_t hop_size, uint_t samplerate);
/** execute tempo detection
@@ -60,7 +60,7 @@
\param tempo output beats
*/
-void aubio_tempo_do (aubio_tempo_t *o, fvec_t * input, fvec_t * tempo);
+void aubio_tempo_do (aubio_tempo_t *o, const fvec_t * input, fvec_t * tempo);
/** get the time of the latest beat detected, in samples