Update of /cvsroot/pure-data/externals/grill/vst/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23700/src
Modified Files:
main.cpp vsthost.cpp vsthost.h
Log Message:
clean handling of plugin deletion (potentially open editor window etc.)
workarounds for Waves5 bundle
Index: vsthost.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/vst/src/vsthost.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** vsthost.h 16 Mar 2005 04:59:35 -0000 1.6
--- vsthost.h 17 Mar 2005 04:57:22 -0000 1.7
***************
*** 68,72 ****
bool Is() const { return effect != NULL; }
! long GetVersion() const { return effect?effect->version:0; }
bool IsSynth() const { return HasFlags(effFlagsIsSynth); }
--- 68,72 ----
bool Is() const { return effect != NULL; }
! long GetVersion() const { return effect->version; }
bool IsSynth() const { return HasFlags(effFlagsIsSynth); }
***************
*** 78,83 ****
const char *GetDllName() const { return dllname.c_str(); }
! int GetNumInputs() const { return effect?effect->numInputs:0; }
! int GetNumOutputs() const { return effect?effect->numOutputs:0; }
void ListPlugs(const t_symbol *sym) const;
--- 78,85 ----
const char *GetDllName() const { return dllname.c_str(); }
! long UniqueID() const { return effect->uniqueID; }
!
! int GetNumInputs() const { return effect->numInputs; }
! int GetNumOutputs() const { return effect->numOutputs; }
void ListPlugs(const t_symbol *sym) const;
Index: vsthost.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/vst/src/vsthost.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** vsthost.cpp 16 Mar 2005 04:59:35 -0000 1.6
--- vsthost.cpp 17 Mar 2005 04:57:22 -0000 1.7
***************
*** 312,316 ****
long plugid;
char tmp[64];
! // scan shell for subplugins
while((plugid = Dispatch(effShellGetNextPlugin,0,0,tmp))) {
// subplug needs a name
--- 312,321 ----
long plugid;
char tmp[64];
!
! // Waves5 continues with the next plug after the last loaded
! // that's not what we want - workaround: swallow all remaining
! while((plugid = Dispatch(effShellGetNextPlugin,0,0,tmp))) {}
!
! // restart from the beginning
while((plugid = Dispatch(effShellGetNextPlugin,0,0,tmp))) {
// subplug needs a name
Index: main.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/vst/src/main.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** main.cpp 16 Mar 2005 04:59:35 -0000 1.25
--- main.cpp 17 Mar 2005 04:57:22 -0000 1.26
***************
*** 27,31 ****
! #define VST_VERSION "0.1.0pre23"
--- 27,31 ----
! #define VST_VERSION "0.1.0pre24"
***************
*** 617,621 ****
void vst::CbSignal()
{
! if(mute)
flext_dsp::CbSignal();
else if(bypass) {
--- 617,621 ----
void vst::CbSignal()
{
! if(!plug || !plug->UniqueID() || mute)
flext_dsp::CbSignal();
else if(bypass) {
***************
*** 652,704 ****
ZeroSamples(outsigs[i],n);
}
! 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;
! if(inputs <= cntin)
! inv = const_cast<t_sample **>(insigs);
! else { // more plug inputs than inlets
! int i;
! for(i = 0; i < cntin; ++i) tmpin[i] = const_cast<t_sample *>(insigs[i]);
! // set dangling inputs to zero
! // according to mode... (e.g. set zero)
! for(; i < inputs; ++i) ZeroSamples(tmpin[i] = vstin[i],n);
! inv = tmpin;
! }
! const bool more = outputs <= cntout;
! if(more) // more outlets than plug outputs
! outv = const_cast<t_sample **>(outsigs);
! else {
! int i;
! for(i = 0; i < cntout; ++i) tmpout[i] = outsigs[i];
! for(; i < outputs; ++i) tmpout[i] = vstout[i];
! outv = tmpout;
! }
! // call plugin DSP function
! (plug->*vstfun)(inv,outv,n);
! if(more) {
! // according to mode set dangling output vectors
! // currently simply clear them....
! for(int i = outputs; i < cntout; ++i)
! ZeroSamples(outsigs[i],n);
! }
}
}
- else
- flext_dsp::CbSignal();
}
--- 652,700 ----
ZeroSamples(outsigs[i],n);
}
! else 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;
! if(inputs <= cntin)
! inv = const_cast<t_sample **>(insigs);
! else { // more plug inputs than inlets
! int i;
! for(i = 0; i < cntin; ++i) tmpin[i] = const_cast<t_sample *>(insigs[i]);
! // set dangling inputs to zero
! // according to mode... (e.g. set zero)
! for(; i < inputs; ++i) ZeroSamples(tmpin[i] = vstin[i],n);
! inv = tmpin;
! }
! const bool more = outputs <= cntout;
! if(more) // more outlets than plug outputs
! outv = const_cast<t_sample **>(outsigs);
! else {
! int i;
! for(i = 0; i < cntout; ++i) tmpout[i] = outsigs[i];
! for(; i < outputs; ++i) tmpout[i] = vstout[i];
! outv = tmpout;
! }
! // call plugin DSP function
! (plug->*vstfun)(inv,outv,n);
! if(more) {
! // according to mode set dangling output vectors
! // currently simply clear them....
! for(int i = outputs; i < cntout; ++i)
! ZeroSamples(outsigs[i],n);
}
}
}