- Timestamp:
- Mar 17, 2017, 6:23:17 PM (8 years ago)
- Branches:
- sampler
- Children:
- f651625
- Parents:
- bad88364
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/synth/sampler.c
rbad88364 rf8bdcb2 77 77 // time stretching 78 78 aubio_timestretch_t *ts; 79 sint_t available; // number of samples currently available 80 uint_t started; // source warmed up 81 // source 82 uint_t source_blocksize; 83 uint_t channels; 84 fvec_t *source_output; 85 fmat_t *source_moutput; 86 //fvec_t *source_output_tmp; 87 //uint_t last_read; 88 uint_t threaded_read; // use reading thread? 79 89 #ifdef HAVE_THREADS 80 90 // file reading thread 81 91 pthread_t read_thread; 82 uint_t threaded_read; // use reading thread?83 92 pthread_mutex_t read_mutex; 84 93 pthread_cond_t read_avail; 85 94 pthread_cond_t read_request; 86 uint_t source_blocksize;87 fvec_t *source_output;88 fvec_t *source_output_tmp;89 uint_t last_read;90 fmat_t *source_moutput;91 uint_t channels;92 95 // file opening thread 93 96 pthread_t open_thread; … … 96 99 char_t *next_uri; 97 100 uint_t open_thread_running; 98 sint_t available; // number of samples currently available99 uint_t started; // source warmed up100 101 uint_t read_thread_finish; // flag to tell reading thread to exit 101 102 #endif … … 137 138 s->available = 0; 138 139 139 s->threaded_read = 0;140 140 s->perfectloop = 0; 141 141 #if 0 // naive mode … … 150 150 s->source_blocksize = 2048; //32 * s->blocksize; 151 151 s->perfectloop = 1; 152 #endif 153 154 #ifdef HAVE_THREADS 155 // disabled for now 152 156 s->threaded_read = 0; 153 #endif 157 #else 158 s->threaded_read = 0; 159 #endif 160 161 s->perfectloop = 1; 154 162 155 163 if (s->source_blocksize < s->blocksize) { … … 186 194 187 195 s->ts = new_aubio_timestretch("default", 1., s->blocksize, s->samplerate); 188 s->source_output_tmp = new_fvec(s->source_blocksize);189 s->last_read = 0;196 //s->source_output_tmp = new_fvec(s->source_blocksize); 197 //s->last_read = 0; 190 198 191 199 return s; … … 272 280 ret = AUBIO_OK; 273 281 AUBIO_MSG("sampler: loaded %s\n", uri); 282 #ifdef HAVE_THREADS 274 283 if (o->waited) { 275 284 AUBIO_WRN("sampler: %.2fms (%d samples) taken to load %s\n", 1000. * 276 285 o->waited / (smpl_t)o->samplerate, o->waited, o->uri); 277 286 } 287 #endif 278 288 } else { 279 289 o->source = NULL; … … 819 829 820 830 uint_t 831 #ifdef HAVE_THREADS 821 832 aubio_sampler_get_waited_opening (aubio_sampler_t *o, uint_t waited) { 822 #ifdef HAVE_THREADS823 833 if (o->playing) { 824 834 if (!o->opened) { … … 832 842 } 833 843 } 844 #else 845 aubio_sampler_get_waited_opening (aubio_sampler_t *o UNUSED, uint_t waited UNUSED) { 834 846 #endif 835 847 return 0; … … 849 861 ret = AUBIO_OK; 850 862 } 851 o->last_read = 0;863 //o->last_read = 0; 852 864 return ret; 853 865 }
Note: See TracChangeset
for help on using the changeset viewer.