src/synth/sampler.h: add _{get,set}_perfectloop
authorPaul Brossier <piem@piem.org>
Mon, 28 Nov 2016 13:50:46 +0000 (14:50 +0100)
committerPaul Brossier <piem@piem.org>
Mon, 28 Nov 2016 13:50:46 +0000 (14:50 +0100)
src/synth/sampler.c
src/synth/sampler.h

index 5e3ad3c..4ff2c1b 100644 (file)
@@ -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
index 027d781..9d1465a 100644 (file)
@@ -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()