Update of /cvsroot/pure-data/externals/grill/vst/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7901/src
Modified Files: editorwin.hpp main.cpp vsthost.cpp vsthost.h vstmaster.cpp Log Message: small OSX things experimenting a bit.... clean handling of plugin deletion (potentially open editor window etc.)
Index: vstmaster.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/vst/src/vstmaster.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** vstmaster.cpp 16 Mar 2005 04:59:35 -0000 1.4 --- vstmaster.cpp 25 Mar 2005 04:55:11 -0000 1.5 *************** *** 71,77 **** long VSTPlugin::Master(AEffect *effect, long opcode, long index, long value, void *ptr, float opt) { ! #ifdef FLEXT_LOGGING ! 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); ! #endif
VSTPlugin *th = effect?(VSTPlugin *)effect->user:NULL; --- 71,76 ---- long VSTPlugin::Master(AEffect *effect, long opcode, long index, long value, void *ptr, float opt) { ! if(opcode != audioMasterGetTime) ! FLEXT_LOG6("VST -> host: Eff = 0x%.8X, Opcode = %d, Index = %d, Value = %d, PTR = %.8X, OPT = %.3f\n",(int)effect, opcode,index,value,(int)ptr,opt);
VSTPlugin *th = effect?(VSTPlugin *)effect->user:NULL; *************** *** 102,114 **** //! \todo set connection state correctly (if possible..) // index=pin, value=0..input, else..output ! #ifdef FLEXT_LOGGING ! post("Pin connected pin=%li conn=%li",index,value); ! #endif return 0; // 0 means connected
case audioMasterWantMidi: // 6 ! #ifdef FLEXT_LOGGING ! post("Want MIDI = %li",value); ! #endif return 0; // VST header says: "currently ignored"
--- 101,109 ---- //! \todo set connection state correctly (if possible..) // index=pin, value=0..input, else..output ! FLEXT_LOG2("Pin connected pin=%li conn=%li",index,value); return 0; // 0 means connected
case audioMasterWantMidi: // 6 ! FLEXT_LOG1("Want MIDI = %li",value); return 0; // VST header says: "currently ignored"
*************** *** 167,173 **** case audioMasterSetTime: { // 9 VstTimeInfo *tminfo = static_cast<VstTimeInfo *>(ptr); ! #ifdef FLEXT_DEBUG ! post("TimeInfo pos=%lf rate=%lf filter=%li",tminfo->samplePos,tminfo->sampleRate,value); ! #endif return 0; // not supported } --- 162,166 ---- case audioMasterSetTime: { // 9 VstTimeInfo *tminfo = static_cast<VstTimeInfo *>(ptr); ! FLEXT_LOG3("TimeInfo pos=%lf rate=%lf filter=%li",tminfo->samplePos,tminfo->sampleRate,value); return 0; // not supported } *************** *** 207,213 ****
case audioMasterCanDo: // 37 ! #ifdef FLEXT_LOGGING ! post("\taudioMasterCanDo PTR = %s",ptr); ! #endif if(!strcmp((char *)ptr,"sendVstEvents")) return 1; --- 200,204 ----
case audioMasterCanDo: // 37 ! FLEXT_LOG1("\taudioMasterCanDo PTR = %s",ptr); if(!strcmp((char *)ptr,"sendVstEvents")) return 1; *************** *** 260,272 ****
case audioMasterUpdateDisplay: // 42 ! #ifdef FLEXT_LOGGING ! post("UPDATE DISPLAY"); ! #endif return 0;
default: ! #ifdef FLEXT_DEBUG ! post("Unknown opcode %li",opcode); ! #endif return 0; } --- 251,259 ----
case audioMasterUpdateDisplay: // 42 ! FLEXT_LOG("UPDATE DISPLAY"); return 0;
default: ! FLEXT_LOG1("Unknown opcode %li",opcode); return 0; }
Index: vsthost.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/vst/src/vsthost.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** vsthost.h 20 Mar 2005 04:57:22 -0000 1.8 --- vsthost.h 25 Mar 2005 04:55:11 -0000 1.9 *************** *** 217,221 **** void AddPitchBend(int value) { ! AddMIDI(MIDI_PITCHBEND+midichannel,((value>>7)&127),(value&127)); }
--- 217,221 ---- void AddPitchBend(int value) { ! AddMIDI(MIDI_PITCHBEND+midichannel,(value&127),((value>>7)&127)); }
*************** *** 292,310 ****
public: ! void processReplacing(float **inputs,float **outputs,long sampleframes ) { FLEXT_ASSERT(effect); ! effect->processReplacing(effect,inputs,outputs,sampleframes); if(playing) updatepos(sampleframes); }
! void process(float **inputs,float **outputs,long sampleframes ) { FLEXT_ASSERT(effect); ! effect->process(effect,inputs,outputs,sampleframes); ! if(playing) updatepos(sampleframes); }
private: void updatepos(long frames);
--- 292,312 ----
public: ! bool processReplacing(float **inputs,float **outputs,long sampleframes ) { FLEXT_ASSERT(effect); ! effect->processReplacing(effect,inputs,outputs,sampleframes); if(playing) updatepos(sampleframes); + return true; }
! bool process(float **inputs,float **outputs,long sampleframes ) { FLEXT_ASSERT(effect); ! effect->process(effect,inputs,outputs,sampleframes); ! return true; }
private: + void updatepos(long frames);
Index: vsthost.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/vst/src/vsthost.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** vsthost.cpp 20 Mar 2005 04:57:22 -0000 1.8 --- vsthost.cpp 25 Mar 2005 04:55:11 -0000 1.9 *************** *** 170,175 ****
#if FLEXT_OS == FLEXT_OS_WIN ! FLEXT_ASSERT(!hdll); ! hdll = LoadLibrary(dllname.c_str()); if(hdll) pluginmain = (PVSTMAIN)GetProcAddress(hdll,"main"); audiomaster = Master; --- 170,174 ----
#if FLEXT_OS == FLEXT_OS_WIN ! hdll = LoadLibraryEx(dllname.c_str(),NULL,0 /*DONT_RESOLVE_DLL_REFERENCES*/); if(hdll) pluginmain = (PVSTMAIN)GetProcAddress(hdll,"main"); audiomaster = Master;
Index: editorwin.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/vst/src/editorwin.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** editorwin.hpp 16 Mar 2005 04:59:35 -0000 1.3 --- editorwin.hpp 25 Mar 2005 04:55:11 -0000 1.4 *************** *** 57,61 **** case WM_TIMER: // fall through case WM_ENTERIDLE: ! plug->EditorIdle(); break; #if 0 --- 57,61 ---- case WM_TIMER: // fall through case WM_ENTERIDLE: ! // plug->EditorIdle(); break; #if 0 *************** *** 226,230 **** --- 226,233 ---- else { TranslateMessage(&msg); + // double tm1 = flext::GetOSTime(); DispatchMessage(&msg); + // double tm2 = flext::GetOSTime(); + // if(tm2-tm1 > 0.01) FLEXT_LOG1("halt %lf",(tm2-tm1)*1000); } }
Index: main.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/vst/src/main.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** main.cpp 20 Mar 2005 04:57:22 -0000 1.27 --- main.cpp 25 Mar 2005 04:55:11 -0000 1.28 *************** *** 13,18 **** #include "main.h"
! #include "Editor.h" ! #include "VstHost.h"
#include <stdlib.h> --- 13,18 ---- #include "main.h"
! #include "editor.h" ! #include "vsthost.h"
#include <stdlib.h> *************** *** 27,31 ****
! #define VST_VERSION "0.1.0pre24"
--- 27,31 ----
! #define VST_VERSION "0.1.0pre26"
*************** *** 158,162 ****
int blsz; ! void (VSTPlugin::*vstfun)(t_sample **insigs,t_sample **outsigs,long n); bool sigmatch; t_sample **vstin,**vstout,**tmpin,**tmpout; --- 158,162 ----
int blsz; ! bool (VSTPlugin::*vstfun)(t_sample **insigs,t_sample **outsigs,long n); bool sigmatch; t_sample **vstin,**vstout,**tmpin,**tmpout; *************** *** 652,657 **** 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(); --- 652,661 ---- ZeroSamples(outsigs[i],n); } ! 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(); *************** *** 687,691 ****
// call plugin DSP function ! (plug->*vstfun)(inv,outv,n);
if(more) { --- 691,698 ----
// call plugin DSP function ! if(!(plug->*vstfun)(inv,outv,n)) { ! for(int i = 0; i < outputs; ++i) ! ZeroSamples(outsigs[i],n); ! }
if(more) {