Update of /cvsroot/pure-data/externals/grill/vst/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30512/src
Modified Files: main.cpp main.h vsthost.cpp vsthost.h vstmaster.cpp Log Message: fixed bug with param method minimal updated for new flext function naming feedback attribute for parameter reporting added event processing (like Midi in)
Index: vstmaster.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/vst/src/vstmaster.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vstmaster.cpp 12 Mar 2005 04:59:16 -0000 1.2 --- vstmaster.cpp 13 Mar 2005 05:02:28 -0000 1.3 *************** *** 79,87 **** switch (opcode) { case audioMasterAutomate: // 0 ! #ifdef FLEXT_LOGGING ! post("Automate index=%li value=%li opt=%f",index,value,opt); ! #endif ! // index, value given ! //! \todo set effect parameter return 0;
--- 79,88 ---- switch (opcode) { case audioMasterAutomate: // 0 ! if(th && th->feedback && th->responder) { ! t_atom lst[2]; ! SetInt(lst[0],index); ! SetFloat(lst[1],opt); ! th->responder->Respond(sym_param,2,lst); ! } return 0;
*************** *** 124,127 **** --- 125,129 ---- if(th->playing) time.flags |= kVstTransportPlaying; if(th->looping) time.flags |= kVstTransportCycleActive; + // if(th->feedback) time.flags |= kVstAutomationWriting;
time.sampleRate = th->samplerate; *************** *** 189,192 **** --- 191,198 ---- return flext::GetThreadId() == flext::GetSysThreadId()?2:1;
+ case audioMasterGetAutomationState: // 24 + // return th?(th->feedback?2:1):0; + return 0; + case audioMasterGetVendorString: // 32 strcpy((char*)ptr,vendor);
Index: vsthost.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/vst/src/vsthost.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** vsthost.h 11 Mar 2005 04:58:01 -0000 1.4 --- vsthost.h 13 Mar 2005 05:02:28 -0000 1.5 *************** *** 215,218 **** --- 215,220 ---- void SetLooping(bool p) { if(looping != p) transchg = true,looping = p; } bool GetLooping() const { return looping; } + void SetFeedback(bool p) { feedback = p; } + bool GetFeedback() const { return feedback; }
void SetSamplePos(double p) { if(samplepos != p) transchg = true,samplepos = p; } *************** *** 241,245 **** private:
! bool playing,looping; float samplerate; bool transchg; --- 243,247 ---- private:
! bool playing,looping,feedback; float samplerate; bool transchg; *************** *** 308,311 **** --- 310,314 ---- static long VSTCALLBACK Master(AEffect *effect, long opcode, long index, long value, void *ptr, float opt);
+ static const t_symbol *sym_param; static const t_symbol *sym_event,*sym_evmidi,*sym_evaudio,*sym_evvideo,*sym_evparam,*sym_evtrigger,*sym_evsysex,*sym_ev_; static const t_symbol *sym_midi[8];
Index: vsthost.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/vst/src/vsthost.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** vsthost.cpp 11 Mar 2005 04:58:01 -0000 1.4 --- vsthost.cpp 13 Mar 2005 05:02:28 -0000 1.5 *************** *** 12,15 **** --- 12,16 ----
const t_symbol + *VSTPlugin::sym_param, *VSTPlugin::sym_event, *VSTPlugin::sym_evmidi, *************** *** 24,27 **** --- 25,29 ---- void VSTPlugin::Setup() { + sym_param = flext::MakeSymbol("param"); sym_event = flext::MakeSymbol("event"); sym_evmidi = flext::MakeSymbol("midi"); *************** *** 51,55 **** , paramnamecnt(0) , transchg(true) ! , playing(false),looping(false) , samplerate(0) , samplepos(0),ppqpos(0) --- 53,57 ---- , paramnamecnt(0) , transchg(true) ! , playing(false),looping(false),feedback(false) , samplerate(0) , samplepos(0),ppqpos(0)
Index: main.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/vst/src/main.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** main.cpp 12 Mar 2005 04:59:16 -0000 1.23 --- main.cpp 13 Mar 2005 05:02:27 -0000 1.24 *************** *** 27,31 ****
! #define VST_VERSION "0.1.0pre20"
--- 27,31 ----
! #define VST_VERSION "0.1.0pre21"
*************** *** 41,48 ****
protected: ! virtual void m_dsp(int n,t_signalvec const *insigs,t_signalvec const *outsigs); ! virtual void m_signal(int n,t_sample *const *insigs,t_sample *const *outsigs);
! virtual void m_click() { ms_edit(true); }
bool ms_plug(int argc,const t_atom *argv); --- 41,48 ----
protected: ! virtual bool CbDsp(); ! virtual void CbSignal();
! virtual void CbClick() { ms_edit(true); }
bool ms_plug(int argc,const t_atom *argv); *************** *** 111,114 **** --- 111,116 ---- void mg_looping(bool &p) { p = plug && plug->GetLooping(); } void ms_looping(bool p) { if(plug) plug->SetLooping(p); } + void mg_feedback(bool &p) { p = plug && plug->GetFeedback(); } + void ms_feedback(bool p) { if(plug) plug->SetFeedback(p); } void mg_samplepos(float &p) { p = plug?(float)plug->GetSamplePos():0; } void ms_samplepos(float p) { if(plug) plug->SetSamplePos(p); } *************** *** 211,214 **** --- 213,217 ---- FLEXT_CALLVAR_B(mg_playing,ms_playing) FLEXT_CALLVAR_B(mg_looping,ms_looping) + FLEXT_CALLVAR_B(mg_feedback,ms_feedback) FLEXT_CALLVAR_F(mg_samplepos,ms_samplepos) FLEXT_CALLVAR_F(mg_ppqpos,ms_ppqpos) *************** *** 262,266 **** FLEXT_CADDATTR_VAR(c,"pnames",paramnames,ms_paramnames); FLEXT_CADDMETHOD_2(c,0,"param",ms_param,int,float); ! FLEXT_CADDMETHOD_2(c,0,"param",ms_params,t_symptr,float); FLEXT_CADDMETHOD_(c,0,"getparam",mg_param); FLEXT_CADDMETHOD_(c,0,"getparam",mg_params); --- 265,269 ---- FLEXT_CADDATTR_VAR(c,"pnames",paramnames,ms_paramnames); FLEXT_CADDMETHOD_2(c,0,"param",ms_param,int,float); ! FLEXT_CADDMETHOD_(c,0,"param",ms_params); FLEXT_CADDMETHOD_(c,0,"getparam",mg_param); FLEXT_CADDMETHOD_(c,0,"getparam",mg_params); *************** *** 287,290 **** --- 290,294 ---- FLEXT_CADDATTR_VAR(c,"playing",mg_playing,ms_playing); FLEXT_CADDATTR_VAR(c,"looping",mg_looping,ms_looping); + FLEXT_CADDATTR_VAR(c,"feedback",mg_feedback,ms_feedback); FLEXT_CADDATTR_VAR(c,"samplepos",mg_samplepos,ms_samplepos); FLEXT_CADDATTR_VAR(c,"ppqpos",mg_ppqpos,ms_ppqpos); *************** *** 567,571 **** }
! void vst::m_dsp(int n,t_signalvec const *,t_signalvec const *) { if(plug) { --- 571,575 ---- }
! bool vst::CbDsp() { if(plug) { *************** *** 580,590 **** } } }
! void vst::m_signal(int n,t_sample *const *insigs,t_sample *const *outsigs) { if(mute) ! flext_dsp::m_signal(n,insigs,outsigs); else if(bypass) { // copy as many channels as possible and zero dangling ones
--- 584,599 ---- } } + return true; }
! void vst::CbSignal() { if(mute) ! flext_dsp::CbSignal(); else if(bypass) { + const int n = Blocksize(); + t_sample *const *insigs = InSig(); + t_sample *const *outsigs = OutSig(); + // copy as many channels as possible and zero dangling ones
*************** *** 616,625 **** } else if(plug) { - const int inputs = plug->GetNumInputs(),outputs = plug->GetNumOutputs(); - if(sigmatch) ! (plug->*vstfun)(const_cast<t_sample **>(insigs),const_cast<t_sample **>(outsigs),n); else { const int cntin = CntInSig(),cntout = CntOutSig(); t_sample **inv,**outv;
--- 625,636 ---- } else if(plug) { if(sigmatch) ! (plug->*vstfun)(const_cast<t_sample **>(InSig()),const_cast<t_sample **>(OutSig()),Blocksize()); else { + const int inputs = plug->GetNumInputs(),outputs = plug->GetNumOutputs(); const int cntin = CntInSig(),cntout = CntOutSig(); + const int n = Blocksize(); + t_sample *const *insigs = InSig(); + t_sample *const *outsigs = OutSig(); t_sample **inv,**outv;
*************** *** 661,665 **** } else ! flext_dsp::m_signal(n,insigs,outsigs); }
--- 672,676 ---- } else ! flext_dsp::CbSignal(); }
Index: main.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/vst/src/main.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** main.h 11 Mar 2005 04:58:01 -0000 1.8 --- main.h 13 Mar 2005 05:02:28 -0000 1.9 *************** *** 15,20 **** #include <flext.h>
! #if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 405) ! #error You need at least flext version 0.4.5 #endif
--- 15,20 ---- #include <flext.h>
! #if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 500) ! #error You need at least flext version 0.5.0 #endif