seems working

This commit is contained in:
Lucas Cordiviola 2024-04-21 07:16:06 -03:00
parent af7afaf8b2
commit bea578104f
5 changed files with 47 additions and 6 deletions

View File

@ -1,4 +1,4 @@
#N canvas 0 265 595 358 12;
#N canvas 0 265 818 358 12;
#X obj 78 87 adc~, f 6;
#X obj 73 241 loadbang;
#X msg 73 271 \; pd dsp 1 \;;
@ -13,10 +13,13 @@
#X obj 242 263 dbtorms;
#X obj 242 290 s gain;
#X obj 300 225 s svstparameter0;
#X obj 277 75 vsl 50 128 0 1 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#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 48 17 0 0 0 - - - 0;
#X obj 516 102 r rvstdata;
#X symbolatom 516 136 17 0 0 0 - - - 0;
#X connect 0 0 7 0;
#X connect 0 1 6 0;
#X connect 1 0 2 0;
@ -33,3 +36,5 @@
#X connect 14 0 13 0;
#X connect 14 0 10 0;
#X connect 15 0 14 0;
#X connect 17 0 18 0;
#X connect 19 0 20 0;

View File

@ -17,5 +17,5 @@ ALL: vstschedlib.c
gcc -Wall -I$(PDDIR)src -I../vst-template vstschedlib.c -static-libgcc \
-shared -L$(PDDIR)bin -l:pd.dll -o vstschedlib.dll
strip vstschedlib.dll
cp vstschedlib.dll ../build/pd-scheduler$(arch)/vstschedlib.dll
#cp vstschedlib.dll ../build/Release$(arch)/.pd/bin/vstschedlib.dll
#cp vstschedlib.dll ../build/pd-scheduler$(arch)/vstschedlib.dll
cp vstschedlib.dll ../build/Release$(arch)/.pd/bin/vstschedlib.dll

View File

@ -70,6 +70,8 @@ typedef struct _vstGuiNameReceiver
t_vstGuiNameReceiver *vstGuiNameReceiver;
t_vstParameterReceiver *vstParameterReceivers[MAXPARAMETERS];
t_class *vstParameterReceiver_class;
@ -195,6 +197,19 @@ int setPdvstPlugName(char* instanceName)
return 0;
}
int setPdvstChunk(char* instanceName)
{
t_symbol *tempSym;
tempSym = gensym("rvstdata");
if (tempSym->s_thing)
{
pd_symbol(tempSym->s_thing, gensym(instanceName));
return 1;
}
else
return 0;
}
int setPdvstFloatParameter(int index, float value)
{
@ -262,6 +277,8 @@ void makePdvstGuiNameReceiver()
void send_dacs(void)
{
int i, j, sampleCount, nChannels, blockSize;
@ -390,6 +407,14 @@ int scheduler()
if (setPdvstPlugName((char*)pdvstData->plugName.value.stringData))
pdvstData->plugName.updated=0;
}
// lucarda get data chunk from file
if (pdvstData->datachunk.direction == PD_RECEIVE && \
pdvstData->datachunk.updated)
{
if (setPdvstChunk((char*)pdvstData->datachunk.value.stringData))
pdvstData->datachunk.updated=0;
}
if (pdvstData->hostTimeInfo.updated)
{

View File

@ -227,6 +227,7 @@ pdvst::pdvst(audioMasterCallback audioMaster)
timeFromStartup=GetTickCount();
// JYG }
programsAreChunks(true);
sendPlugName(globalPluginName);
}
pdvst::~pdvst()
@ -609,7 +610,16 @@ VstInt32 pdvst::getChunk (void** data, bool isPreset)
}
VstInt32 pdvst::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
{
WaitForSingleObject(pdvstTransferMutex, 10);
{
pdvstData->datachunk.direction = PD_RECEIVE;
pdvstData->datachunk.type = STRING_TYPE;
strcpy(pdvstData->datachunk.value.stringData,(char *)data);
pdvstData->datachunk.updated = 1;
ReleaseMutex(pdvstTransferMutex);
}
MessageBox(0,"setchunk","debug",MB_OK);
debugLog("setchunk: %s", data);
return 1;

View File

@ -121,6 +121,7 @@ typedef struct _pdvstTransferData
pdvstMidiMessage midiQueue[MAXMIDIQUEUESIZE];
pdvstParameter guiState;
pdvstParameter plugName; // transmitted by host
pdvstParameter datachunk; // get/set chunk from .fxp file
pdvstParameter guiName; // transmitted by pd : name of gui window to be embedded
// #ifdef VSTMIDIOUTENABLE
int midiOutQueueSize;