Changeset 1e4b7f6


Ignore:
Timestamp:
Sep 29, 2016, 4:21:50 PM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
sampler, timestretch
Children:
30efdd0
Parents:
b4ad853
Message:

src/effects/timestretch_rubberband.c: split into functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/effects/timestretch_rubberband.c

    rb4ad853 r1e4b7f6  
    5252extern RubberBandOptions aubio_get_rubberband_opts(const char_t *mode);
    5353
     54static void aubio_timestretch_warmup (aubio_timestretch_t * p);
     55static sint_t aubio_timestretch_fetch(aubio_timestretch_t *p);
     56
    5457aubio_timestretch_t *
    5558new_aubio_timestretch (const char_t * uri, const char_t * mode,
     
    8689  //rubberband_set_debug_level(p->rb, 10);
    8790
    88 #if 1
     91  aubio_timestretch_warmup(p);
     92
     93  return p;
     94
     95beach:
     96  del_aubio_timestretch(p);
     97  return NULL;
     98}
     99
     100static void
     101aubio_timestretch_warmup (aubio_timestretch_t * p)
     102{
    89103  // warm up rubber band
    90104  uint_t source_read = 0;
     
    98112    available = rubberband_available(p->rb);
    99113  }
    100 #endif
    101 
    102   return p;
    103 
    104 beach:
    105   del_aubio_timestretch(p);
    106   return NULL;
    107114}
    108115
     
    184191}
    185192
    186 void
    187 aubio_timestretch_do (aubio_timestretch_t * p, fvec_t * out, uint_t * read)
     193sint_t
     194aubio_timestretch_fetch(aubio_timestretch_t *p)
    188195{
    189196  uint_t source_read = p->hopsize;
     
    198205    available = rubberband_available(p->rb);
    199206  }
     207  return source_read;
     208}
     209
     210void
     211aubio_timestretch_do (aubio_timestretch_t * p, fvec_t * out, uint_t * read)
     212{
     213  int available = aubio_timestretch_fetch(p);
    200214  // now retrieve the samples and write them into out->data
    201215  if (available >= (int)p->hopsize) {
Note: See TracChangeset for help on using the changeset viewer.