Ignore:
Timestamp:
Jun 27, 2017, 4:56:00 PM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
sampler
Parents:
04d0c89
Message:

src/synth/sampler.h: add aubio_sampler_get_duration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/synth/sampler.c

    r04d0c89 r1686fcf  
    5757  uint_t samplerate;
    5858  uint_t blocksize;
     59  uint_t duration;
    5960  // current reading mode (can be a file or an array)
    6061  uint_t reading_from;
     
    129130  s->samplerate = samplerate;
    130131  s->blocksize = blocksize;
     132  s->duration = 0;
    131133  s->source = NULL;
    132134  s->playing = 0;
     
    279281    o->opened = 1;
    280282    ret = AUBIO_OK;
     283    o->duration = duration;
    281284    AUBIO_MSG("sampler: loaded %s\n", uri);
    282285#ifdef HAVE_THREADS
     
    811814
    812815uint_t
     816aubio_sampler_get_duration (aubio_sampler_t *o)
     817{
     818  if (o->duration !=0) {
     819    return o->duration;
     820  } else {
     821    AUBIO_WRN("sampler: failed getting duration for %s\n", o->uri);
     822    return 0;
     823  }
     824}
     825
     826uint_t
    813827aubio_sampler_get_opened (aubio_sampler_t *o)
    814828{
Note: See TracChangeset for help on using the changeset viewer.