From: Paul Brossier Date: Wed, 18 Dec 2013 06:29:16 +0000 (-0500) Subject: src/lvec.h: clean up lvec api X-Git-Tag: 0.4.0~1 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=6ede3abe1c4ed8d853547d116fb732380661a536;p=aubio.git src/lvec.h: clean up lvec api --- diff --git a/src/lvec.c b/src/lvec.c index 69d0f036..a97fd8bd 100644 --- a/src/lvec.c +++ b/src/lvec.c @@ -39,7 +39,7 @@ void del_lvec(lvec_t *s) { void lvec_write_sample(lvec_t *s, lsmp_t data, uint_t position) { s->data[position] = data; } -lsmp_t lvec_read_sample(lvec_t *s, uint_t position) { +lsmp_t lvec_get_sample(lvec_t *s, uint_t position) { return s->data[position]; } @@ -57,7 +57,7 @@ void lvec_print(lvec_t *s) { AUBIO_MSG("\n"); } -void lvec_set(lvec_t *s, smpl_t val) { +void lvec_set_all (lvec_t *s, smpl_t val) { uint_t j; for (j=0; j< s->length; j++) { s->data[j] = val; @@ -68,11 +68,11 @@ void lvec_zeros(lvec_t *s) { #if HAVE_MEMCPY_HACKS memset(s->data, 0, s->length * sizeof(lsmp_t)); #else - lvec_set(s, 0.); + lvec_set_all (s, 0.); #endif } void lvec_ones(lvec_t *s) { - lvec_set(s, 1.); + lvec_set_all (s, 1.); } diff --git a/src/lvec.h b/src/lvec.h index 80d4aa6f..c5750f15 100644 --- a/src/lvec.h +++ b/src/lvec.h @@ -57,36 +57,26 @@ lvec_t * new_lvec(uint_t length); */ void del_lvec(lvec_t *s); -/** read sample value in a buffer - Note that this function is not used in the aubio library, since the same - result can be obtained using vec->data[position]. Its purpose is to - access these values from wrappers, as created by swig. +/** read sample value in a buffer \param s vector to read from \param position sample position to read from */ -lsmp_t lvec_read_sample(lvec_t *s, uint_t position); -/** write sample value in a buffer +lsmp_t lvec_get_sample(lvec_t *s, uint_t position); - Note that this function is not used in the aubio library, since the same - result can be obtained by assigning vec->data[position]. Its purpose - is to access these values from wrappers, as created by swig. +/** write sample value in a buffer \param s vector to write to \param data value to write in s->data[position] \param position sample position to write to */ -void lvec_write_sample(lvec_t *s, lsmp_t data, uint_t position); +void lvec_set_sample(lvec_t *s, lsmp_t data, uint_t position); /** read data from a buffer - Note that this function is not used in the aubio library, since the same - result can be obtained with vec->data. Its purpose is to access these values - from wrappers, as created by swig. - \param s vector to read from */ @@ -105,7 +95,7 @@ void lvec_print(lvec_t *s); \param val value to set elements to */ -void lvec_set(lvec_t *s, smpl_t val); +void lvec_set_all(lvec_t *s, smpl_t val); /** set all elements to zero