program change name and number receivers
This commit is contained in:
parent
290c706d1a
commit
d149365889
@ -16,12 +16,16 @@
|
||||
#X obj 277 75 vsl 50 128 0 1 0 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1;
|
||||
#X msg 277 42 set \$1;
|
||||
#X text 355 117 range is 0..1;
|
||||
#X obj 498 10 r rvstplugname;
|
||||
#X symbolatom 498 42 26 0 0 0 - - - 0;
|
||||
#X obj 516 102 r rvstdata;
|
||||
#X obj 516 265 s svstdata;
|
||||
#X obj 516 134 print;
|
||||
#X msg 516 233 test 1.3 hello 0.3 2 ff;
|
||||
#X obj 543 14 r rvstplugname;
|
||||
#X symbolatom 543 46 26 0 0 0 - - - 0;
|
||||
#X obj 710 282 r rvstdata;
|
||||
#X obj 499 312 s svstdata;
|
||||
#X obj 710 314 print;
|
||||
#X msg 499 280 test 1.3 hello 0.3 2 ff;
|
||||
#X symbolatom 545 126 26 0 0 0 - - - 0;
|
||||
#X obj 545 94 r rvstprogname;
|
||||
#X floatatom 543 185 12 0 0 0 - - - 0;
|
||||
#X obj 543 157 r rvstprognumber;
|
||||
#X connect 0 0 7 0;
|
||||
#X connect 0 1 6 0;
|
||||
#X connect 1 0 2 0;
|
||||
@ -41,3 +45,5 @@
|
||||
#X connect 17 0 18 0;
|
||||
#X connect 19 0 21 0;
|
||||
#X connect 22 0 20 0;
|
||||
#X connect 24 0 23 0;
|
||||
#X connect 26 0 25 0;
|
||||
|
@ -205,7 +205,6 @@ int setPdvstPlugName(char* instanceName)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*receive data chunk from host*/
|
||||
int setPdvstChunk(const char *amsg)
|
||||
{
|
||||
@ -491,7 +490,7 @@ int scheduler()
|
||||
pdvstData->plugName.updated=0;
|
||||
}
|
||||
|
||||
// get data chunk from file
|
||||
// check for data chunk from file
|
||||
if (pdvstData->datachunk.direction == PD_RECEIVE && \
|
||||
pdvstData->datachunk.updated)
|
||||
{
|
||||
@ -499,6 +498,29 @@ int scheduler()
|
||||
pdvstData->datachunk.updated=0;
|
||||
}
|
||||
|
||||
// check for vst program name changed
|
||||
if (pdvstData->prognumber2pd.direction == PD_RECEIVE && \
|
||||
pdvstData->prognumber2pd.updated)
|
||||
{
|
||||
t_symbol *tempSym;
|
||||
tempSym = gensym("rvstprognumber");
|
||||
if (tempSym->s_thing)
|
||||
pd_float(tempSym->s_thing, (t_float)pdvstData->prognumber2pd.value.floatData);
|
||||
pdvstData->prognumber2pd.updated=0;
|
||||
}
|
||||
|
||||
// check for vst program number changed
|
||||
if (pdvstData->progname2pd.direction == PD_RECEIVE && \
|
||||
pdvstData->progname2pd.updated)
|
||||
{
|
||||
t_symbol *tempSym;
|
||||
tempSym = gensym("rvstprogname");
|
||||
if (tempSym->s_thing)
|
||||
pd_symbol(tempSym->s_thing, \
|
||||
gensym(pdvstData->progname2pd.value.stringData));
|
||||
pdvstData->progname2pd.updated=0;
|
||||
}
|
||||
|
||||
if (pdvstData->hostTimeInfo.updated)
|
||||
{
|
||||
pdvstData->hostTimeInfo.updated=0;
|
||||
|
@ -493,6 +493,25 @@ void pdvst::resume()
|
||||
}
|
||||
}
|
||||
|
||||
void pdvst::sendProgChange(VstInt32 prgm)
|
||||
{
|
||||
|
||||
WaitForSingleObject(pdvstTransferMutex, 10);
|
||||
{
|
||||
pdvstData->prognumber2pd.direction = PD_RECEIVE;
|
||||
pdvstData->prognumber2pd.type = FLOAT_TYPE;
|
||||
pdvstData->prognumber2pd.value.floatData = (float)prgm;
|
||||
pdvstData->prognumber2pd.updated = 1;
|
||||
|
||||
pdvstData->progname2pd.direction = PD_RECEIVE;
|
||||
pdvstData->progname2pd.type = STRING_TYPE;
|
||||
strcpy(pdvstData->progname2pd.value.stringData, program[prgm].name);
|
||||
pdvstData->progname2pd.updated = 1;
|
||||
|
||||
ReleaseMutex(pdvstTransferMutex);
|
||||
}
|
||||
}
|
||||
|
||||
void pdvst::setProgram(VstInt32 prgmNum)
|
||||
{
|
||||
debugLog("appel de setProgram %d", prgmNum);
|
||||
@ -500,6 +519,7 @@ void pdvst::setProgram(VstInt32 prgmNum)
|
||||
if (prgmNum >= 0 && prgmNum < nPrograms)
|
||||
{
|
||||
curProgram = prgmNum;
|
||||
sendProgChange(prgmNum);
|
||||
|
||||
|
||||
// {JYG to prevent host call of setProgram to override current param settings
|
||||
@ -625,7 +645,7 @@ VstInt32 pdvst::getChunk (void** data, bool isPreset)
|
||||
}
|
||||
|
||||
VstInt32 pdvst::setChunk (void* data, VstInt32 byteSize, bool isPreset)
|
||||
{
|
||||
{
|
||||
//MessageBoxA(NULL, "setchunk call", "debug", MB_OK);
|
||||
if(byteSize)
|
||||
{
|
||||
@ -1132,9 +1152,9 @@ void pdvst::updatePdvstParameters()
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// to data chunk
|
||||
|
||||
|
||||
if (pdvstData->datachunk.direction == PD_SEND && \
|
||||
pdvstData->datachunk.updated)
|
||||
{
|
||||
|
@ -99,8 +99,9 @@ public:
|
||||
// virtual VstInt32 canMono ();
|
||||
virtual void suspend();
|
||||
virtual void resume();
|
||||
void sendGuiAction(int action);
|
||||
void sendPlugName(char * name ); // JYG : to send plug name to puredatapatch
|
||||
void sendGuiAction(int action);
|
||||
void sendPlugName(char * name ); // JYG : to send plug name to puredatapatch
|
||||
void sendProgChange(VstInt32 prgm); // send vst prog name and number to patch
|
||||
|
||||
LPTSTR displayString;//= new TCHAR[MAXSTRINGSIZE];
|
||||
|
||||
|
@ -121,7 +121,9 @@ typedef struct _pdvstTransferData
|
||||
pdvstMidiMessage midiQueue[MAXMIDIQUEUESIZE];
|
||||
pdvstParameter guiState;
|
||||
pdvstParameter plugName; // transmitted by host
|
||||
pdvstParameter datachunk; // get/set chunk from .fxp file
|
||||
pdvstParameter datachunk; // get/set chunk from .fxp .fxb files
|
||||
pdvstParameter progname2pd; // send program name to Pd
|
||||
pdvstParameter prognumber2pd; // send program name to Pd
|
||||
pdvstParameter guiName; // transmitted by pd : name of gui window to be embedded
|
||||
// #ifdef VSTMIDIOUTENABLE
|
||||
int midiOutQueueSize;
|
||||
|
Loading…
Reference in New Issue
Block a user