Changeset 4b7747d
- Timestamp:
- Jan 6, 2014, 2:11:55 AM (11 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- d13e6b7
- Parents:
- 6d509c3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink.c
r6d509c3 r4b7747d 30 30 #endif 31 31 32 typedef void (*aubio_sink_do_t)(aubio_sink_t * s, fvec_t * data, uint_t write); 33 #if 0 34 typedef void (*aubio_sink_do_multi_t)(aubio_sink_t * s, fmat_t * data, uint_t * read); 35 typedef uint_t (*aubio_sink_get_samplerate_t)(aubio_sink_t * s); 36 typedef uint_t (*aubio_sink_get_channels_t)(aubio_sink_t * s); 37 #endif 38 typedef uint_t (*del_aubio_sink_t)(aubio_sink_t * s); 39 32 40 struct _aubio_sink_t { 33 41 void *sink; 42 aubio_sink_do_t s_do; 43 #if 0 44 aubio_sink_do_multi_t s_do_multi; 45 aubio_sink_get_samplerate_t s_get_samplerate; 46 aubio_sink_get_channels_t s_get_channels; 47 #endif 48 del_aubio_sink_t s_del; 34 49 }; 35 50 … … 38 53 #ifdef __APPLE__ 39 54 s->sink = (void *)new_aubio_sink_apple_audio(uri, samplerate); 40 if (s->sink) return s; 41 #else /* __APPLE__ */ 55 if (s->sink) { 56 s->s_do = (aubio_sink_do_t)(aubio_sink_apple_audio_do); 57 s->s_del = (del_aubio_sink_t)(del_aubio_sink_apple_audio); 58 return s; 59 } 60 #endif /* __APPLE__ */ 42 61 #if HAVE_SNDFILE 43 62 s->sink = (void *)new_aubio_sink_sndfile(uri, samplerate); 44 if (s->sink) return s; 63 if (s->sink) { 64 s->s_do = (aubio_sink_do_t)(aubio_sink_sndfile_do); 65 s->s_del = (del_aubio_sink_t)(del_aubio_sink_sndfile); 66 return s; 67 } 45 68 #endif /* HAVE_SNDFILE */ 46 #endif /* __APPLE__ */ 47 AUBIO_ERROR("failed creating aubio sink with %s\n", uri); 69 AUBIO_ERROR("sink: failed creating aubio sink with %s\n", uri); 48 70 AUBIO_FREE(s); 49 71 return NULL; … … 51 73 52 74 void aubio_sink_do(aubio_sink_t * s, fvec_t * write_data, uint_t write) { 53 #ifdef __APPLE__ 54 aubio_sink_apple_audio_do((aubio_sink_apple_audio_t *)s->sink, write_data, write); 55 #else /* __APPLE__ */ 56 #if HAVE_SNDFILE 57 aubio_sink_sndfile_do((aubio_sink_sndfile_t *)s->sink, write_data, write); 58 #endif /* HAVE_SNDFILE */ 59 #endif /* __APPLE__ */ 75 s->s_do((void *)s->sink, write_data, write); 60 76 } 61 77 62 78 void del_aubio_sink(aubio_sink_t * s) { 63 79 if (!s) return; 64 #ifdef __APPLE__ 65 del_aubio_sink_apple_audio((aubio_sink_apple_audio_t *)s->sink); 66 #else /* __APPLE__ */ 67 #if HAVE_SNDFILE 68 del_aubio_sink_sndfile((aubio_sink_sndfile_t *)s->sink); 69 #endif /* HAVE_SNDFILE */ 70 #endif /* __APPLE__ */ 80 s->s_del((void *)s->sink); 71 81 AUBIO_FREE(s); 72 82 return;
Note: See TracChangeset
for help on using the changeset viewer.