diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2002-12-28 04:37:42 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2002-12-28 04:37:42 +0000 |
commit | 562dcc336797951b2a8707413aa44177484c9f2a (patch) | |
tree | 162adc736d99b6edf4c03e50061831006ac0f5c4 /externals/grill/xsample/source | |
parent | 7b0d76e0a6c7b58f6a7a373755c46bde52ebea79 (diff) |
""
svn path=/trunk/; revision=309
Diffstat (limited to 'externals/grill/xsample/source')
-rw-r--r-- | externals/grill/xsample/source/groove.cpp | 41 | ||||
-rw-r--r-- | externals/grill/xsample/source/main.cpp | 33 | ||||
-rw-r--r-- | externals/grill/xsample/source/main.h | 3 | ||||
-rw-r--r-- | externals/grill/xsample/source/play.cpp | 11 | ||||
-rw-r--r-- | externals/grill/xsample/source/record.cpp | 35 |
5 files changed, 53 insertions, 70 deletions
diff --git a/externals/grill/xsample/source/groove.cpp b/externals/grill/xsample/source/groove.cpp index 795eb654..e756f28a 100644 --- a/externals/grill/xsample/source/groove.cpp +++ b/externals/grill/xsample/source/groove.cpp @@ -22,8 +22,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. class xgroove: public xinter { -// FLEXT_HEADER_S(xgroove,xinter,setup) - FLEXT_HEADER(xgroove,xinter) + FLEXT_HEADER_S(xgroove,xinter,setup) public: xgroove(I argc,const t_atom *argv); @@ -87,7 +86,7 @@ protected: V mg_pos(F &v) const { v = curpos*s2u; } private: -// static V setup(t_class *c); + static V setup(t_class *c); virtual V s_dsp(); @@ -129,14 +128,24 @@ private: FLEXT_LIB_DSP_V("xgroove~",xgroove) -/* -V xgroove::setup(t_class *) + +V xgroove::setup(t_class *c) { -#ifndef PD - post("loaded xgroove~ - part of xsample objects, version " XSAMPLE_VERSION " - (C) Thomas Grill, 2001-2002"); -#endif + FLEXT_CADDMETHOD_(c,0,"all",m_all); + FLEXT_CADDMETHOD(c,1,m_min); + FLEXT_CADDMETHOD(c,2,m_max); + + FLEXT_CADDATTR_VAR(c,"min",mg_min,m_min); + FLEXT_CADDATTR_VAR(c,"max",mg_max,m_max); + FLEXT_CADDATTR_VAR(c,"pos",mg_pos,m_pos); + + FLEXT_CADDATTR_VAR_E(c,"loop",loopmode,m_loop); + + FLEXT_CADDMETHOD_F(c,0,"xzone",m_xzone); + FLEXT_CADDMETHOD_F(c,0,"xsymm",m_xsymm); + FLEXT_CADDMETHOD_(c,0,"xshape",m_xshape); + FLEXT_CADDMETHOD_B(c,0,"xkeep",m_xkeep); } -*/ xgroove::xgroove(I argc,const t_atom *argv): loopmode(xsl_loop),curpos(0), @@ -175,20 +184,6 @@ xgroove::xgroove(I argc,const t_atom *argv): AddOutFloat(2); // play min & max AddOutBang(); // loop bang - FLEXT_ADDMETHOD_(0,"all",m_all); - FLEXT_ADDMETHOD(1,m_min); - FLEXT_ADDMETHOD(2,m_max); - - FLEXT_ADDATTR_VAR("min",mg_min,m_min); - FLEXT_ADDATTR_VAR("max",mg_max,m_max); - FLEXT_ADDATTR_VAR("pos",mg_pos,m_pos); - - FLEXT_ADDATTR_VAR_E("loop",loopmode,m_loop); - - FLEXT_ADDMETHOD_F(0,"xzone",m_xzone); - FLEXT_ADDMETHOD_F(0,"xsymm",m_xsymm); - FLEXT_ADDMETHOD_(0,"xshape",m_xshape); - FLEXT_ADDMETHOD_B(0,"xkeep",m_xkeep); znbuf = new S *[outchns]; for(I i = 0; i < outchns; ++i) znbuf[i] = new S[0]; diff --git a/externals/grill/xsample/source/main.cpp b/externals/grill/xsample/source/main.cpp index d8182f57..4097ed98 100644 --- a/externals/grill/xsample/source/main.cpp +++ b/externals/grill/xsample/source/main.cpp @@ -36,6 +36,23 @@ FLEXT_LIB_SETUP(xsample,lib_setup) // ------------------------------ +void xsample::setup(t_class *c) +{ + FLEXT_CADDBANG(c,0,m_start); + FLEXT_CADDMETHOD_(c,0,"start",m_start); + FLEXT_CADDMETHOD_(c,0,"stop",m_stop); + + FLEXT_CADDMETHOD_(c,0,"set",m_set); + FLEXT_CADDMETHOD_(c,0,"print",m_print); + FLEXT_CADDMETHOD_(c,0,"refresh",m_refresh); + FLEXT_CADDMETHOD_(c,0,"reset",m_reset); + + FLEXT_CADDATTR_VAR(c,"buffer",mg_buffer,ms_buffer); + FLEXT_CADDATTR_VAR_E(c,"units",unitmode,m_units); + FLEXT_CADDATTR_VAR_E(c,"sclmode",sclmode,m_sclmode); + FLEXT_CADDATTR_GET(c,"scale",s2u); +} + xsample::xsample(): buf(NULL), #if FLEXT_SYS == FLEXT_SYS_MAX @@ -45,21 +62,7 @@ xsample::xsample(): #endif sclmode(xss_unitsinbuf), curmin(0),curmax(1<<30) -{ - FLEXT_ADDBANG(0,m_start); - FLEXT_ADDMETHOD_(0,"start",m_start); - FLEXT_ADDMETHOD_(0,"stop",m_stop); - - FLEXT_ADDMETHOD_(0,"set",m_set); - FLEXT_ADDMETHOD_(0,"print",m_print); - FLEXT_ADDMETHOD_(0,"refresh",m_refresh); - FLEXT_ADDMETHOD_(0,"reset",m_reset); - - FLEXT_ADDATTR_VAR("buffer",mg_buffer,ms_buffer); - FLEXT_ADDATTR_VAR_E("units",unitmode,m_units); - FLEXT_ADDATTR_VAR_E("sclmode",sclmode,m_sclmode); - FLEXT_ADDATTR_GET("scale",s2u); -} +{} xsample::~xsample() { diff --git a/externals/grill/xsample/source/main.h b/externals/grill/xsample/source/main.h index f0c1bff9..dfc8147c 100644 --- a/externals/grill/xsample/source/main.h +++ b/externals/grill/xsample/source/main.h @@ -64,7 +64,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. class xsample: public flext_dsp { - FLEXT_HEADER(xsample,flext_dsp) + FLEXT_HEADER_S(xsample,flext_dsp,setup) public: xsample(); @@ -126,6 +126,7 @@ protected: V mg_max(F &v) const { v = curmax*s2u; } private: + static V setup(t_class *c); FLEXT_CALLBACK(m_start) FLEXT_CALLBACK(m_stop) diff --git a/externals/grill/xsample/source/play.cpp b/externals/grill/xsample/source/play.cpp index 3b934ecb..c2e6ef41 100644 --- a/externals/grill/xsample/source/play.cpp +++ b/externals/grill/xsample/source/play.cpp @@ -18,7 +18,6 @@ WARRANTIES, see the file, "license.txt," in this distribution. class xplay: public xinter { -// FLEXT_HEADER_S(xplay,xinter,setup) FLEXT_HEADER(xplay,xinter) public: @@ -34,8 +33,6 @@ public: virtual V m_print(); private: -// static V setup(t_class *c); - virtual V m_signal(I n,S *const *in,S *const *out) { bufchk(); @@ -45,14 +42,6 @@ private: FLEXT_LIB_DSP_V("xplay~",xplay) -/* -V xplay::setup(t_class *) -{ -#ifndef PD - post("loaded xplay~ - part of xsample objects, version " XSAMPLE_VERSION " - (C) Thomas Grill, 2001-2002"); -#endif -} -*/ xplay::xplay(I argc,const t_atom *argv) { diff --git a/externals/grill/xsample/source/record.cpp b/externals/grill/xsample/source/record.cpp index d3ce5cee..318e01d2 100644 --- a/externals/grill/xsample/source/record.cpp +++ b/externals/grill/xsample/source/record.cpp @@ -18,8 +18,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. class xrecord: public xsample { -// FLEXT_HEADER_S(xrecord,xsample,setup) - FLEXT_HEADER(xrecord,xsample) + FLEXT_HEADER_S(xrecord,xsample,setup) public: xrecord(I argc,const t_atom *argv); @@ -67,7 +66,7 @@ protected: V outputmax() { ToOutFloat(outmax,curmax*s2u); } private: -// static V setup(t_class *c); + static V setup(t_class *c); virtual V s_dsp(); @@ -97,14 +96,21 @@ private: FLEXT_LIB_DSP_V("xrecord~",xrecord) -/* -V xrecord::setup(t_class *) + +V xrecord::setup(t_class *c) { -#ifndef PD - post("loaded xrecord~ - part of xsample objects, version " XSAMPLE_VERSION " - (C) Thomas Grill, 2001-2002"); -#endif + FLEXT_CADDMETHOD_F(c,0,"pos",m_pos); + FLEXT_CADDMETHOD_F(c,0,"min",m_min); + FLEXT_CADDMETHOD_F(c,0,"max",m_max); + FLEXT_CADDMETHOD_(c,0,"all",m_all); + + FLEXT_CADDMETHOD_(c,0,"draw",m_draw); + + FLEXT_CADDATTR_VAR1(c,"loop",doloop); + FLEXT_CADDATTR_VAR1(c,"mixmode",mixmode); + FLEXT_CADDATTR_VAR1(c,"sigmode",sigmode); + FLEXT_CADDATTR_VAR(c,"append",appmode,m_append); } -*/ xrecord::xrecord(I argc,const t_atom *argv): dorec(false), @@ -144,19 +150,8 @@ xrecord::xrecord(I argc,const t_atom *argv): AddOutFloat(2); // min & max AddOutBang(); // loop bang - FLEXT_ADDMETHOD_F(0,"pos",m_pos); FLEXT_ADDMETHOD(inchns+1,m_min); FLEXT_ADDMETHOD(inchns+2,m_max); - FLEXT_ADDMETHOD_F(0,"min",m_min); - FLEXT_ADDMETHOD_F(0,"max",m_max); - FLEXT_ADDMETHOD_(0,"all",m_all); - - FLEXT_ADDMETHOD_(0,"draw",m_draw); - - FLEXT_ADDATTR_VAR1("loop",doloop); - FLEXT_ADDATTR_VAR1("mixmode",mixmode); - FLEXT_ADDATTR_VAR1("sigmode",sigmode); - FLEXT_ADDATTR_VAR("append",appmode,m_append); } |