From 428806256328220836f6833c7b0fea5bc7157eac Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Thu, 17 Mar 2005 04:57:22 +0000 Subject: clean handling of plugin deletion (potentially open editor window etc.) workarounds for Waves5 bundle svn path=/trunk/; revision=2631 --- externals/grill/vst/pd/help-vst~.pd | 86 ++++++++++++++++++------------------- externals/grill/vst/readme.txt | 7 +-- externals/grill/vst/src/main.cpp | 84 +++++++++++++++++------------------- externals/grill/vst/src/vsthost.cpp | 7 ++- externals/grill/vst/src/vsthost.h | 8 ++-- 5 files changed, 96 insertions(+), 96 deletions(-) (limited to 'externals/grill') diff --git a/externals/grill/vst/pd/help-vst~.pd b/externals/grill/vst/pd/help-vst~.pd index d1a93cc4..7f9ea7b1 100644 --- a/externals/grill/vst/pd/help-vst~.pd +++ b/externals/grill/vst/pd/help-vst~.pd @@ -1,7 +1,7 @@ -#N canvas 80 16 858 559 12; +#N canvas 30 4 850 551 12; #X obj 26 94 noise~; -#X obj 229 189 print A; -#X obj 27 393 tgl 15 0 empty empty empty 0 -6 0 8 -261689 -1 -1 1 1 +#X obj 240 189 print A; +#X obj 27 393 tgl 15 0 empty empty empty 0 -6 0 8 -261689 -1 -1 0 1 ; #X msg 27 435 edit \$1; #X msg 97 435 getedit; @@ -40,19 +40,19 @@ #X connect 16 0 7 0; #X connect 18 0 7 0; #X connect 20 0 7 0; -#X restore 516 114 pd info; -#X obj 96 96 r \$0-vst; -#X obj 26 462 s \$0-vst; +#X restore 521 97 pd info; +#X obj 96 94 r \$0-vst; +#X obj 27 462 s \$0-vst; #X text 52 392 display edit window; #X msg 104 309 getplug; -#X obj 25 337 s \$0-vst; +#X obj 26 337 s \$0-vst; #X text 64 263 set/get plugin; -#X text 582 114 further information; +#X text 587 97 further information; #X obj 23 15 cnv 15 800 58 empty empty vst~ 10 32 0 24 -260818 -1 0 ; -#X text 226 170 attribute outlet; +#X text 237 170 attribute outlet; #X text 103 132 inlets outlets [plugname]; -#N canvas 351 2 626 581 win 0; +#N canvas 351 2 630 585 win 0; #X obj 23 202 s \$0-vst; #X msg 122 83 getx; #X msg 181 85 gety; @@ -120,13 +120,13 @@ #X connect 30 0 31 0; #X connect 31 0 0 0; #X connect 32 0 0 0; -#X restore 515 244 pd win; -#X text 581 244 manipulating the edit window; -#X msg 27 310 plug \$1; +#X restore 520 227 pd win; +#X text 586 227 manipulating the edit window; +#X msg 26 310 plug \$1; #X obj 26 254 bng 25 250 50 0 empty empty empty 0 -6 0 8 -261689 -1 -1; #X obj 26 285 openpanel; -#N canvas 294 23 530 659 midi 0; +#N canvas 294 23 534 663 midi 0; #X obj 16 256 s \$0-vst; #X msg 198 201 ctlchg 3 123; #X text 204 70 note on; @@ -188,24 +188,24 @@ ctlchg \, progchg \, pbend; #X connect 28 0 29 0; #X connect 29 0 0 0; #X connect 30 0 0 0; -#X restore 516 212 pd midi; +#X restore 521 195 pd midi; #X text 134 33 based on the work of Jarno Seppanen and Mark Williamson ; #X obj 742 456 loadbang; #X msg 742 483 \; pd dsp 1; -#X obj 518 449 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0 +#X obj 520 449 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 1 1; -#X obj 516 498 s \$0-vst; -#X msg 517 471 bypass \$1; -#X msg 599 471 getbypass; -#X text 543 448 bypass plugin; -#X obj 518 357 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0 +#X obj 520 498 s \$0-vst; +#X msg 520 471 bypass \$1; +#X msg 602 471 getbypass; +#X text 545 448 bypass plugin; +#X obj 520 357 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0 1; -#X obj 516 406 s \$0-vst; -#X text 543 356 mute output; -#X msg 517 379 mute \$1; -#X msg 599 379 getmute; -#N canvas 200 110 493 444 parameters 0; +#X obj 520 405 s \$0-vst; +#X text 545 356 mute output; +#X msg 520 378 mute \$1; +#X msg 602 378 getmute; +#N canvas 200 110 497 448 parameters 0; #X obj 114 125 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -225271 -1 -1 0 1; #X msg 111 142 param 2 \$1; @@ -245,8 +245,8 @@ ctlchg \, progchg \, pbend; #X connect 17 0 18 0; #X connect 18 0 2 0; #X connect 19 0 2 0; -#X restore 515 147 pd parameters; -#N canvas 0 0 462 312 programs 0; +#X restore 520 130 pd parameters; +#N canvas 0 0 466 316 programs 0; #X obj 39 245 s \$0-vst; #X msg 162 106 getprogram; #X text 134 34 get number of programs; @@ -276,19 +276,19 @@ ctlchg \, progchg \, pbend; #X connect 10 0 0 0; #X connect 12 0 14 0; #X connect 14 0 0 0; -#X restore 516 179 pd programs; -#X text 632 148 VST parameters; -#X text 633 179 VST programs; +#X restore 521 162 pd programs; +#X text 637 131 VST parameters; +#X text 638 162 VST programs; #X text 134 53 http://grrrr.org; -#X text 584 213 midi messages for VST synths; -#X msg 276 313 subplug AudioTrack; -#X obj 261 398 s \$0-vst; -#X msg 283 368 getsubplug; +#X text 589 196 midi messages for VST synths; +#X msg 264 314 subplug AudioTrack; +#X obj 249 399 s \$0-vst; +#X msg 271 369 getsubplug; #X obj 26 135 vst~ 2 2 @pnames 100; -#X msg 261 282 getpluglist; -#X text 580 271 sequencer stuff; +#X msg 249 283 getpluglist; +#X text 585 254 sequencer stuff; #X text 133 14 VST plugins for PD \, (C)2003-2005 Thomas Grill; -#X msg 281 340 subplug X-Noise; +#X msg 269 341 subplug X-Noise; #N canvas 0 0 466 316 out 0; #X obj 79 164 *~; #X obj 79 194 dac~ 1 2 3 4; @@ -318,8 +318,8 @@ ctlchg \, progchg \, pbend; #X connect 11 0 10 0; #X restore 26 192 pd out; #X obj 72 175 hsl 128 15 0.001 1 1 1 empty empty gain -2 -6 0 8 -261689 --1 -1 4100 1; -#N canvas 105 36 490 647 seq 0; +-1 -1 6400 1; +#N canvas 105 36 494 651 seq 0; #X obj 17 225 s \$0-vst; #X msg 112 78 samplepos \$1; #X obj 111 60 nbx 5 14 0 1e+037 0 0 empty empty empty 0 -6 0 10 -225271 @@ -410,12 +410,12 @@ ctlchg \, progchg \, pbend; #X connect 35 0 36 0; #X connect 36 0 0 0; #X connect 37 0 0 0; -#X restore 515 273 pd seq; +#X restore 520 256 pd seq; #X text 23 508 on the vst~ object box; #X text 24 491 you can also alt-click; #X obj 27 413 pipe 100; -#X text 261 243 functions for plugin shells; -#X text 259 259 (like Waves); +#X text 249 244 functions for plugin shells; +#X text 247 260 (like Waves); #X connect 0 0 44 0; #X connect 0 0 44 1; #X connect 2 0 54 0; diff --git a/externals/grill/vst/readme.txt b/externals/grill/vst/readme.txt index 6cebdeb7..03914813 100644 --- a/externals/grill/vst/readme.txt +++ b/externals/grill/vst/readme.txt @@ -62,6 +62,7 @@ Version history: - pre22: cleaner GUI code, all kinds of window handling - pre22: catch exceptions like crashing plugs - pre23: security measures for open edit window +- pre24: workarounds for Waves5 strangenesses 0.0.0: - version of mark@junklight.com @@ -70,12 +71,8 @@ Version history: BUGS: - mouse interaction in editor can cause audio dropouts -- crash when unloading plugin with open window TODO: -- examine why Waveshell behaves so strange (vendor string length exceed VST specification) -- add VSTTimeInfo functionality -- add Midi out functionality - include necessary Steinberg license stuff -- do name scanning in the background +- do plugin loading, name scanning in the background - translate special characters in strings (like ° as param_label) into system-digestible form diff --git a/externals/grill/vst/src/main.cpp b/externals/grill/vst/src/main.cpp index d1c369c3..29263cdd 100644 --- a/externals/grill/vst/src/main.cpp +++ b/externals/grill/vst/src/main.cpp @@ -26,7 +26,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #endif -#define VST_VERSION "0.1.0pre23" +#define VST_VERSION "0.1.0pre24" class vst @@ -616,7 +616,7 @@ bool vst::CbDsp() void vst::CbSignal() { - if(mute) + if(!plug || !plug->UniqueID() || mute) flext_dsp::CbSignal(); else if(bypass) { const int n = Blocksize(); @@ -651,55 +651,51 @@ void vst::CbSignal() for(; i < CntOutSig(); ++i) ZeroSamples(outsigs[i],n); } - else if(plug) { - if(sigmatch) - (plug->*vstfun)(const_cast(InSig()),const_cast(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(insigs); - else { // more plug inputs than inlets - int i; - for(i = 0; i < cntin; ++i) tmpin[i] = const_cast(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; - } + else if(sigmatch) + (plug->*vstfun)(const_cast(InSig()),const_cast(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; - const bool more = outputs <= cntout; - if(more) // more outlets than plug outputs - outv = const_cast(outsigs); - else { - int i; - for(i = 0; i < cntout; ++i) tmpout[i] = outsigs[i]; - for(; i < outputs; ++i) tmpout[i] = vstout[i]; + if(inputs <= cntin) + inv = const_cast(insigs); + else { // more plug inputs than inlets + int i; + for(i = 0; i < cntin; ++i) tmpin[i] = const_cast(insigs[i]); - outv = tmpout; - } + // set dangling inputs to zero + // according to mode... (e.g. set zero) + for(; i < inputs; ++i) ZeroSamples(tmpin[i] = vstin[i],n); - // call plugin DSP function - (plug->*vstfun)(inv,outv,n); + inv = tmpin; + } - if(more) { - // according to mode set dangling output vectors + const bool more = outputs <= cntout; + if(more) // more outlets than plug outputs + outv = const_cast(outsigs); + else { + int i; + for(i = 0; i < cntout; ++i) tmpout[i] = outsigs[i]; + for(; i < outputs; ++i) tmpout[i] = vstout[i]; - // currently simply clear them.... - for(int i = outputs; i < cntout; ++i) - ZeroSamples(outsigs[i],n); - } + 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(); } void vst::mg_progname(int argc,const t_atom *argv) const diff --git a/externals/grill/vst/src/vsthost.cpp b/externals/grill/vst/src/vsthost.cpp index 5f2443fc..8cb69f93 100644 --- a/externals/grill/vst/src/vsthost.cpp +++ b/externals/grill/vst/src/vsthost.cpp @@ -311,7 +311,12 @@ bool VSTPlugin::Instance(const char *name,const char *subname) long plugid; char tmp[64]; - // scan shell for subplugins + + // 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 FLEXT_LOG1("subplug %s",tmp); diff --git a/externals/grill/vst/src/vsthost.h b/externals/grill/vst/src/vsthost.h index 0b1adef0..d4365e97 100644 --- a/externals/grill/vst/src/vsthost.h +++ b/externals/grill/vst/src/vsthost.h @@ -67,7 +67,7 @@ private: public: bool Is() const { return effect != NULL; } - long GetVersion() const { return effect?effect->version:0; } + long GetVersion() const { return effect->version; } bool IsSynth() const { return HasFlags(effFlagsIsSynth); } bool IsReplacing() const { return HasFlags(effFlagsCanReplacing); } @@ -77,8 +77,10 @@ public: const char *GetVendorName() const { return vendorname; } const char *GetDllName() const { return dllname.c_str(); } - int GetNumInputs() const { return effect?effect->numInputs:0; } - int GetNumOutputs() const { return effect?effect->numOutputs:0; } + 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; -- cgit v1.2.1