diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2005-03-25 04:55:11 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2005-03-25 04:55:11 +0000 |
commit | b3cfaffbe0124254f5da70857f6c1cec59184897 (patch) | |
tree | 0be6278fc661be17a1fe0ca65238adaebecafcaa /externals/grill/vst/src/main.cpp | |
parent | 7b21867fc1b9af84cd0f097b71f3bf456c9b5afd (diff) |
small OSX things
experimenting a bit....
clean handling of plugin deletion (potentially open editor window etc.)
svn path=/trunk/; revision=2646
Diffstat (limited to 'externals/grill/vst/src/main.cpp')
-rw-r--r-- | externals/grill/vst/src/main.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/externals/grill/vst/src/main.cpp b/externals/grill/vst/src/main.cpp index d90cac4a..d0e5a6c0 100644 --- a/externals/grill/vst/src/main.cpp +++ b/externals/grill/vst/src/main.cpp @@ -12,8 +12,8 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "main.h" -#include "Editor.h" -#include "VstHost.h" +#include "editor.h" +#include "vsthost.h" #include <stdlib.h> #include <string.h> @@ -26,7 +26,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #endif -#define VST_VERSION "0.1.0pre24" +#define VST_VERSION "0.1.0pre26" class vst @@ -157,7 +157,7 @@ private: int paramnames; int blsz; - void (VSTPlugin::*vstfun)(t_sample **insigs,t_sample **outsigs,long n); + bool (VSTPlugin::*vstfun)(t_sample **insigs,t_sample **outsigs,long n); bool sigmatch; t_sample **vstin,**vstout,**tmpin,**tmpout; @@ -651,8 +651,12 @@ void vst::CbSignal() for(; i < CntOutSig(); ++i) ZeroSamples(outsigs[i],n); } - else if(sigmatch) - (plug->*vstfun)(const_cast<t_sample **>(InSig()),const_cast<t_sample **>(OutSig()),Blocksize()); + else if(sigmatch) { + if(!(plug->*vstfun)(const_cast<t_sample **>(InSig()),const_cast<t_sample **>(OutSig()),Blocksize())) { + for(int i = 0; i < CntOutSig(); ++i) + ZeroSamples(OutSig()[i],Blocksize()); + } + } else { const int inputs = plug->GetNumInputs(),outputs = plug->GetNumOutputs(); const int cntin = CntInSig(),cntout = CntOutSig(); @@ -686,7 +690,10 @@ void vst::CbSignal() } // call plugin DSP function - (plug->*vstfun)(inv,outv,n); + if(!(plug->*vstfun)(inv,outv,n)) { + for(int i = 0; i < outputs; ++i) + ZeroSamples(outsigs[i],n); + } if(more) { // according to mode set dangling output vectors |