From 943ef49f095d85f10fbce0796a65ee1be180d05c Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 28 Nov 2016 14:50:46 +0100 Subject: [PATCH] src/synth/sampler.h: add _{get,set}_perfectloop --- src/synth/sampler.c | 11 +++++++++++ src/synth/sampler.h | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/synth/sampler.c b/src/synth/sampler.c index 5e3ad3cc..4ff2c1b0 100644 --- a/src/synth/sampler.c +++ b/src/synth/sampler.c @@ -785,6 +785,17 @@ uint_t aubio_sampler_trigger ( aubio_sampler_t * o ) return aubio_sampler_set_playing (o, 1); } +uint_t aubio_sampler_set_perfectloop (aubio_sampler_t *s, uint_t perfectloop) { + if (!s) return AUBIO_FAIL; + s->perfectloop = perfectloop; + return AUBIO_OK; +} + +uint_t aubio_sampler_get_perfectloop (aubio_sampler_t *s) { + if (!s) return AUBIO_FAIL; + return s->perfectloop; +} + void del_aubio_sampler( aubio_sampler_t * o ) { #ifdef HAVE_THREADS diff --git a/src/synth/sampler.h b/src/synth/sampler.h index 027d7813..9d1465ac 100644 --- a/src/synth/sampler.h +++ b/src/synth/sampler.h @@ -220,6 +220,26 @@ uint_t aubio_sampler_get_samplerate(aubio_sampler_t * o); */ uint_t aubio_sampler_get_waited_opening(aubio_sampler_t * o, uint_t waited); +/** get the current perfect loop mode + + \param o sampler, created by new_aubio_sampler() + + \return the total delay in samples when the file was successfuly opened, 0 + otherwise + +*/ +uint_t aubio_sampler_get_perfectloop (aubio_sampler_t *o); + +/** set the perfect loop mode + + \param o sampler, created by new_aubio_sampler() + \param perfectloop 1 to set perfect loop mode, 0 to turn it of + + \return AUBIO_OK on success, AUBIO_FAIL otherwise + + */ +uint_t aubio_sampler_set_perfectloop (aubio_sampler_t *o, uint_t perfectloop); + /** seek to position \param o sampler, created by new_aubio_sampler() -- 2.11.0