diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-02-11 04:37:35 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-02-11 04:37:35 +0000 |
commit | 97926eb08cf74f277e522ffb8c7f985457822de3 (patch) | |
tree | 680b0e4c564057340a0b528ea6468d4e381a907d /externals/grill/xsample/source/play.cpp | |
parent | 06f62d1168209ca6b9e2c3c5264c96a0a4c7cc98 (diff) |
""
svn path=/trunk/; revision=388
Diffstat (limited to 'externals/grill/xsample/source/play.cpp')
-rw-r--r-- | externals/grill/xsample/source/play.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/externals/grill/xsample/source/play.cpp b/externals/grill/xsample/source/play.cpp index 50f32e75..037bc1bb 100644 --- a/externals/grill/xsample/source/play.cpp +++ b/externals/grill/xsample/source/play.cpp @@ -32,11 +32,7 @@ public: private: static V setup(t_classid c); - virtual V m_signal(I n,S *const *in,S *const *out) - { - bufchk(); - playfun(n,in,out); - } + virtual V m_signal(I n,S *const *in,S *const *out); }; FLEXT_LIB_DSP_V("xplay~",xplay) @@ -91,7 +87,20 @@ BL xplay::Init() else return false; } - + +V xplay::m_signal(I n,S *const *in,S *const *out) +{ + // check whether buffer is invalid or changed + if(bufchk()) { + // convert position units to frames + arrmul(n,in[0],out[0]); + // call resample routine + playfun(n,out,out); + } + else + zerofun(n,out,out); +} + V xplay::m_help() @@ -117,8 +126,8 @@ V xplay::m_help() post("\tstop: stop playing"); post("\treset: checks buffer"); post("\trefresh: checks buffer and refreshes outlets"); - post("\tunits 0/1/2/3: set units to samples/buffer size/ms/s"); - post("\tinterp 0/1/2: set interpolation to off/4-point/linear"); + post("\t@units 0/1/2/3: set units to samples/buffer size/ms/s"); + post("\t@interp 0/1/2: set interpolation to off/4-point/linear"); post(""); } |