Changeset 194ef6b
- Timestamp:
- Sep 25, 2009, 4:09:25 AM (15 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:
- c423c3d
- Parents:
- d69e37d
- Location:
- ext
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ext/jackio.c
rd69e37d r194ef6b 18 18 */ 19 19 20 #include "config.h" 21 #ifdef HAVE_JACK 20 #include <aubio.h> 21 22 #if HAVE_JACK 22 23 #include <jack/jack.h> 23 24 #include "aubio_priv.h" 24 25 #include "jackio.h" 25 26 26 /*typedef jack_default_audio_sample_t jack_sample_t; */ 27 /* work with float, never tried in double */ 28 typedef smpl_t jack_sample_t; 27 typedef jack_default_audio_sample_t jack_sample_t; 28 29 #if !AUBIO_SINGLE_PRECISION 30 #define AUBIO_JACK_MAX_FRAMES 4096 31 #define AUBIO_JACK_NEEDS_CONVERSION 32 #endif 29 33 30 34 /** … … 42 46 /** jack output buffer */ 43 47 jack_sample_t **obufs; 48 #ifdef AUBIO_JACK_NEEDS_CONVERSION 49 /** converted jack input buffer */ 50 smpl_t **sibufs; 51 /** converted jack output buffer */ 52 smpl_t **sobufs; 53 #endif 44 54 /** jack input channels */ 45 55 uint_t ichan; … … 139 149 jack_setup->ibufs = AUBIO_ARRAY(jack_sample_t*, ichan); 140 150 jack_setup->obufs = AUBIO_ARRAY(jack_sample_t*, ochan); 151 #ifdef AUBIO_JACK_NEEDS_CONVERSION 152 jack_setup->sibufs = AUBIO_ARRAY(smpl_t*, ichan); 153 uint_t i; 154 for (i = 0; i < ichan; i++) { 155 jack_setup->sibufs[i] = AUBIO_ARRAY(smpl_t, AUBIO_JACK_MAX_FRAMES); 156 } 157 jack_setup->sobufs = AUBIO_ARRAY(smpl_t*, ochan); 158 for (i = 0; i < ochan; i++) { 159 jack_setup->sobufs[i] = AUBIO_ARRAY(smpl_t, AUBIO_JACK_MAX_FRAMES); 160 } 161 #endif 141 162 return jack_setup; 142 163 } … … 168 189 (jack_sample_t *) jack_port_get_buffer (dev->oports[i], nframes); 169 190 } 191 #ifndef AUBIO_JACK_NEEDS_CONVERSION 170 192 dev->callback(dev->ibufs,dev->obufs,nframes); 193 #else 194 uint_t j; 195 for (j = 0; j < MIN(nframes, AUBIO_JACK_MAX_FRAMES); j++) { 196 for (i = 0; i < dev->ichan; i++) { 197 dev->sibufs[i][j] = (smpl_t)dev->ibufs[i][j]; 198 } 199 } 200 dev->callback(dev->sibufs, dev->sobufs, nframes); 201 for (j = 0; j < MIN(nframes, AUBIO_JACK_MAX_FRAMES); j++) { 202 for (i = 0; i < dev->ichan; i++) { 203 dev->obufs[i][j] = (jack_sample_t)dev->sobufs[i][j]; 204 } 205 } 206 #endif 171 207 return 0; 172 208 } -
ext/jackio.h
rd69e37d r194ef6b 35 35 typedef struct _aubio_jack_t aubio_jack_t; 36 36 /** jack process function */ 37 typedef int (*aubio_process_func_t)( float **input, float **output, int38 nframes);37 typedef int (*aubio_process_func_t)(smpl_t **input, 38 smpl_t **output, int nframes); 39 39 40 40 /** jack device creation function */
Note: See TracChangeset
for help on using the changeset viewer.