From 65092b7f63e129a416a32f0e0071547fba86d6d5 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Tue, 24 Feb 2004 03:37:12 +0000 Subject: "" svn path=/trunk/; revision=1355 --- externals/grill/vst/config-pd-msvc.txt | 2 + externals/grill/vst/makefile.pd-msvc | 2 +- externals/grill/vst/pd/vst~.pd | 6 +-- externals/grill/vst/readme.txt | 6 +-- externals/grill/vst/src/EditorWin.cpp | 30 +++++++---- externals/grill/vst/src/VstHost.cpp | 50 ++++++++++++++--- externals/grill/vst/src/VstHost.h | 2 +- externals/grill/vst/src/main.cpp | 2 +- externals/grill/vst/vst.vcproj | 98 ++++------------------------------ 9 files changed, 83 insertions(+), 115 deletions(-) (limited to 'externals/grill/vst') diff --git a/externals/grill/vst/config-pd-msvc.txt b/externals/grill/vst/config-pd-msvc.txt index ebd41e4b..61c8abb9 100644 --- a/externals/grill/vst/config-pd-msvc.txt +++ b/externals/grill/vst/config-pd-msvc.txt @@ -17,6 +17,8 @@ FLEXTPATH=$(PDPATH)\flext # (only necessary if not run from within the build environment) # MSVCPATH=c:\programme\prog\microsoft visual studio\VC98 +# where is the VST SDK? +VSTSDK=F:\prog\audio\vstsdk2.3 # where should the external be built? OUTPATH=pd-msvc diff --git a/externals/grill/vst/makefile.pd-msvc b/externals/grill/vst/makefile.pd-msvc index aaddf3e2..c28151fd 100644 --- a/externals/grill/vst/makefile.pd-msvc +++ b/externals/grill/vst/makefile.pd-msvc @@ -15,7 +15,7 @@ !include config-pd-msvc.txt # includes -INCPATH=/I"$(MSVCPATH)\include" /I"$(PDPATH)\src" /I"$(FLEXTPATH)" +INCPATH=/I"$(MSVCPATH)\include" /I"$(PDPATH)\src" /I"$(FLEXTPATH)" /I"$(VSTSDK)\source\common" LIBPATH=/LIBPATH:"$(PDPATH)\bin" /LIBPATH:"$(FLEXTPATH)" /LIBPATH:"$(MSVCPATH)\lib" LIBS=pd.lib pthreadVC.lib user32.lib flext_t-pdwin.lib diff --git a/externals/grill/vst/pd/vst~.pd b/externals/grill/vst/pd/vst~.pd index 752a16fd..b8837589 100644 --- a/externals/grill/vst/pd/vst~.pd +++ b/externals/grill/vst/pd/vst~.pd @@ -1,14 +1,14 @@ -#N canvas 123 23 866 651 12; +#N canvas 123 23 868 653 12; #X obj 26 190 dac~; #X obj 26 94 noise~; #X obj 444 172 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -225271 -1 -1 0 1; #X msg 441 189 param 2 \$1; #X obj 133 191 print A; -#X obj 27 451 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 1 1 +#X obj 27 451 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0 1 ; #X msg 26 473 vis \$1; -#X obj 27 367 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 1 1 +#X obj 27 367 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0 1 ; #X msg 26 389 edit \$1; #X msg 94 389 getedit; diff --git a/externals/grill/vst/readme.txt b/externals/grill/vst/readme.txt index c33c56e3..20c0107c 100644 --- a/externals/grill/vst/readme.txt +++ b/externals/grill/vst/readme.txt @@ -60,6 +60,6 @@ features: - include necessary Steinberg license stuff BUGS: -- strange: GRM reson stutters when GUI is edited with the mouse (mousedown) - -> plug sends (a lot of) idle messages - -> no stuttering when a message is posted to the console... ähem +- Quadrafuzz crashes on closing editor window +- Waveshell crashes on load + diff --git a/externals/grill/vst/src/EditorWin.cpp b/externals/grill/vst/src/EditorWin.cpp index 5418ba80..9a79c391 100644 --- a/externals/grill/vst/src/EditorWin.cpp +++ b/externals/grill/vst/src/EditorWin.cpp @@ -11,17 +11,18 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "VstHost.h" #include +#include + #if FLEXT_OS == FLEXT_OS_WIN // only Windows code is situated in this file #include -#include - typedef std::map WndMap; static WndMap wndmap; static flext::ThrMutex mapmutex; +#define TIMER_INTERVAL 25 #define WCLNAME "vst~-class" @@ -118,16 +119,27 @@ static void threadfun(flext::thr_params *p) // plug->Dispatch(effEditTop,0,0, 0,0.0f); // printf("Dispatched to the top\n"); - SetTimer(wnd,0,25,NULL); + SetTimer(wnd,0,TIMER_INTERVAL,NULL); + + WINDOWINFO winfo; + winfo.cbSize = sizeof(winfo); + GetWindowInfo(wnd,&winfo); + TITLEBARINFO tinfo; + tinfo.cbSize = sizeof(tinfo); + GetTitleBarInfo(wnd,&tinfo); ERect r; plug->GetEditorRect(r); -// SetWindowPos(wnd,HWND_TOP,plug->getX(),plug->getY(),(r.right - r.left) + 6 , r.bottom - r.top + 26 , SWP_SHOWWINDOW); - SetWindowPos(wnd,HWND_TOP,r.left,r.top,(r.right - r.left) + 6 , r.bottom - r.top + 26 , SWP_SHOWWINDOW); - - // ShowWindow( SW_SHOW ); - // BringWindowToTop(wnd); - // SetFocus(); + SetWindowPos(wnd,HWND_TOP, + r.left, + r.top, + (r.right-r.left)+winfo.cxWindowBorders*2, + (r.bottom-r.top)+(tinfo.rcTitleBar.bottom-tinfo.rcTitleBar.top)+winfo.cyWindowBorders*2, + SWP_SHOWWINDOW + ); + + + // SetFocus(); // Message pump MSG msg; diff --git a/externals/grill/vst/src/VstHost.cpp b/externals/grill/vst/src/VstHost.cpp index 75cd3d35..826827f6 100644 --- a/externals/grill/vst/src/VstHost.cpp +++ b/externals/grill/vst/src/VstHost.cpp @@ -15,7 +15,7 @@ using namespace std; static VstTimeInfo _timeInfo; -typedef AEffect *(*PVSTMAIN)(audioMasterCallback audioMaster); +typedef AEffect *(VSTCALLBACK *PVSTMAIN)(audioMasterCallback audioMaster); VSTPlugin::VSTPlugin(): @@ -55,12 +55,28 @@ int VSTPlugin::Instance(const char *dllname) //init plugin _pEffect->user = this; - FLEXT_ASSERT(Dispatch( effOpen )); -// Dispatch( effMainsChanged, 0, 1); + + long ret = Dispatch( effOpen ); + FLEXT_ASSERT(!ret); + + ret = Dispatch( effIdentify); + FLEXT_ASSERT(ret == 'NvEf'); if (!Dispatch( effGetProductString, 0, 0, &_sProductName, 0.0f)) { + // no product name given by plugin -> extract it from the filename + string str1(dllname); - string str2 = str1.substr(str1.rfind('\\')+1); + string::size_type slpos = str1.rfind('\\'); + if(slpos == string::npos) { + slpos = str1.rfind('/'); + if(slpos == string::npos) + slpos = 0; + else + ++slpos; + } + else + ++slpos; + string str2 = str1.substr(slpos); int snip = str2.find('.'); if( snip != string::npos ) str1 = str2.substr(0,snip); @@ -73,7 +89,12 @@ int VSTPlugin::Instance(const char *dllname) strcpy(_sVendorName, "Unknown vendor"); _sDllName = dllname; - + +/* + Dispatch( effMainsChanged, 0, 1); + Dispatch( effSetSampleRate, 0, 0,NULL,44100.); + Dispatch( effSetBlockSize, 0, 64); +*/ return VSTINSTANCE_NO_ERROR; } @@ -324,10 +345,23 @@ void VSTPlugin::process( float **inputs, float **outputs, long sampleframes ) long VSTPlugin::Master(AEffect *effect, long opcode, long index, long value, void *ptr, float opt) { switch (opcode) { - case audioMasterVersion: + case audioMasterAutomate: // 0 + // index, value given + //! \todo set effect parameter + return 0; + case audioMasterVersion: // 1 return 2; - case audioMasterCurrentId: - return 'AASH'; + case audioMasterCurrentId: // 2 + return 0; + case audioMasterIdle: // 3 +// effect->dispatcher(effect, effEditIdle, 0, 0, NULL, 0.0f); + return 0; + case audioMasterPinConnected: // 4 + //! \todo set connection state correctly (if possible..) + // index=pin, value=0..input, else..output + return 0; // 0 means connected + case audioMasterGetTime: // 7 + return 0; // not supported default: #ifdef FLEXT_DEBUG post("VST -> host: Eff = 0x%.8X, Opcode = %d, Index = %d, Value = %d, PTR = %.8X, OPT = %.3f\n",(int)effect, opcode,index,value,(int)ptr,opt); diff --git a/externals/grill/vst/src/VstHost.h b/externals/grill/vst/src/VstHost.h index 6b856956..397501c5 100644 --- a/externals/grill/vst/src/VstHost.h +++ b/externals/grill/vst/src/VstHost.h @@ -116,7 +116,7 @@ public: return Is()?_pEffect->dispatcher(_pEffect, opCode, index, value, ptr, opt):0; } - static long Master(AEffect *effect, long opcode, long index, long value, void *ptr, float opt); + static long VSTCALLBACK Master(AEffect *effect, long opcode, long index, long value, void *ptr, float opt); void SetPos(int x,int y,bool upd = true); void SetX(int x,bool upd = true) { SetPos(x,posy,upd); } diff --git a/externals/grill/vst/src/main.cpp b/externals/grill/vst/src/main.cpp index 76de5c27..54450c77 100644 --- a/externals/grill/vst/src/main.cpp +++ b/externals/grill/vst/src/main.cpp @@ -20,7 +20,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. using namespace std; -#define VST_VERSION "0.1.0pre10" +#define VST_VERSION "0.1.0pre11" class vst: diff --git a/externals/grill/vst/vst.vcproj b/externals/grill/vst/vst.vcproj index f67fca04..87e92483 100644 --- a/externals/grill/vst/vst.vcproj +++ b/externals/grill/vst/vst.vcproj @@ -176,7 +176,7 @@ OutputFile="$(outdir)/vst~.dll" LinkIncremental="1" SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories="f:\prog\pd\pd-cvs\bin;f:\prog\packs\pthreads" + AdditionalLibraryDirectories="f:\prog\pd\pd-cvs\bin,f:\prog\packs\pthreads" ProgramDatabaseFile=".\pd-msvc/r/vst~.pdb" OptimizeReferences="2" ImportLibrary=".\pd-msvc/r/vst~.lib" @@ -218,108 +218,28 @@ Name="vst" Filter=""> + RelativePath="..\..\audio\vstsdk2.3\source\common\AEffect.h"> + RelativePath="..\..\audio\vstsdk2.3\source\common\aeffectx.h"> + RelativePath="..\..\audio\vstsdk2.3\source\common\AEffEditor.hpp"> + RelativePath="..\..\audio\vstsdk2.3\source\common\AudioEffect.hpp"> + RelativePath="..\..\audio\vstsdk2.3\source\common\audioeffectx.h"> - - - - - - - - - - - + RelativePath="..\..\audio\vstsdk2.3\source\common\vstcontrols.h"> - - - - - - - - - + RelativePath="..\..\audio\vstsdk2.3\source\common\vstfxstore.h"> - - - - - - - - - + RelativePath="..\..\audio\vstsdk2.3\source\common\vstgui.h">