Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5654/src
Modified Files: Tag: devel_0_38 s_audio_asio.cpp Log Message: better style....
Index: s_audio_asio.cpp =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/s_audio_asio.cpp,v retrieving revision 1.1.4.13 retrieving revision 1.1.4.14 diff -C2 -d -r1.1.4.13 -r1.1.4.14 *** s_audio_asio.cpp 18 Nov 2004 22:27:08 -0000 1.1.4.13 --- s_audio_asio.cpp 18 Nov 2004 22:50:44 -0000 1.1.4.14 *************** *** 522,554 **** static void zerovec_nrm(t_sample *dst,int n) { memset(dst,0,n*sizeof(t_sample)); }
! static void (*_copyvec)(t_sample *dst,t_sample *src,int n) = ©vec_nrm; ! static void (*_zerovec)(t_sample *dst,int n) = &zerovec_nrm; ! static t_int *(*_clipperf)(t_int *w) = &clip_perform; ! ! inline void copyblock(t_sample *dst,t_sample *src) { _copyvec(dst,src,sys_dacblocksize); } ! inline void zeroblock(t_sample *dst) { _zerovec(dst,sys_dacblocksize); } ! inline void clipblock(t_int *w) { _clipperf(w); }
! static void setblockops() { if(SIMD_CHKCNT(sys_dacblocksize)) { // urgh... ugly cast ! _copyvec = (void (*)(t_sample *,t_sample *,int))©vec_simd; ! _zerovec = &zerovec_simd; ! _clipperf = &clip_perf_simd; } else { ! _copyvec = ©vec_nrm; ! _zerovec = &zerovec_nrm; ! _clipperf = &clip_perform; } - } - - /*************************************************************************/
! /* called on every dac~ send */ ! int asio_send_dacs(void) ! { ! setblockops();
t_sample * sp; /* sample pointer */ --- 522,548 ---- static void zerovec_nrm(t_sample *dst,int n) { memset(dst,0,n*sizeof(t_sample)); }
! /*************************************************************************/
! /* called on every dac~ send */ ! int asio_send_dacs(void) { + /* set block copy/zero/clip functions */ + void (*copyblock)(t_sample *dst,t_sample *src,int n); + void (*zeroblock)(t_sample *dst,int n); + t_int *(*clipblock)(t_int *w); + if(SIMD_CHKCNT(sys_dacblocksize)) { // urgh... ugly cast ! copyblock = (void (*)(t_sample *,t_sample *,int))©vec_simd; ! zeroblock = &zerovec_simd; ! clipblock = &clip_perf_simd; } else { ! copyblock = ©vec_nrm; ! zeroblock = &zerovec_nrm; ! clipblock = &clip_perform; }
! /*************************************/
t_sample * sp; /* sample pointer */ *************** *** 583,587 **** clipblock(clipargs);
! zeroblock(sp); sp+=sys_dacblocksize; } --- 577,581 ---- clipblock(clipargs);
! zeroblock(sp,sys_dacblocksize); sp+=sys_dacblocksize; } *************** *** 606,610 **** #else /* working but higher latency */ ! copyblock(sp, asio_ringbuffer[i+j] + asio_ringbuffer_inoffset); #endif sp+=sys_dacblocksize; --- 600,604 ---- #else /* working but higher latency */ ! copyblock(sp, asio_ringbuffer[i+j] + asio_ringbuffer_inoffset,sys_dacblocksize); #endif sp+=sys_dacblocksize;