programsarechunks flag working

This commit is contained in:
Lucas Cordiviola 2024-04-22 09:17:15 -03:00
parent ba3b030e41
commit 8b1ee165f2
4 changed files with 22 additions and 3 deletions

View File

@ -25,6 +25,11 @@ DEBUG = TRUE
# ***OBSOLETE, use [declare] inside patch instead*** # ***OBSOLETE, use [declare] inside patch instead***
#LIB = #LIB =
# Save and Get Pd lists in .fxp file via ([s svstdata] and [r rvstdata])
# Some hosts don't work correctly with this.
# If in doubt just use FALSE.
PROGRAMSARECHUNKS = TRUE
# Number of VST parameters (up to 128) # Number of VST parameters (up to 128)
PARAMETERS = 1 PARAMETERS = 1

View File

@ -23,7 +23,7 @@ DEBUG = FALSE
# External libraries (comma delimited list, relative to pdvst/) # External libraries (comma delimited list, relative to pdvst/)
# ***OBSOLETE, use [declare] inside patch instead*** # ***OBSOLETE, use [declare] inside patch instead***
#LIB = #LIB =
# Number of VST parameters (up to 128) # Number of VST parameters (up to 128)
PARAMETERS = 1 PARAMETERS = 1

View File

@ -56,6 +56,7 @@ extern char globalHostPdvstPath[MAXFILENAMELEN];
extern bool globalCustomGui; extern bool globalCustomGui;
extern int globalCustomGuiWidth; extern int globalCustomGuiWidth;
extern int globalCustomGuiHeight; extern int globalCustomGuiHeight;
extern bool globalProgramsAreChunks;
extern bool globalIsASynth; extern bool globalIsASynth;
extern pdvstProgram globalProgram[MAXPROGRAMS]; extern pdvstProgram globalProgram[MAXPROGRAMS];
@ -226,7 +227,7 @@ pdvst::pdvst(audioMasterCallback audioMaster)
// {JYG see pdvst::setProgram below for explanation // {JYG see pdvst::setProgram below for explanation
timeFromStartup=GetTickCount(); timeFromStartup=GetTickCount();
// JYG } // JYG }
programsAreChunks(false); programsAreChunks(globalProgramsAreChunks);
sendPlugName(globalPluginName); sendPlugName(globalPluginName);
} }
@ -616,7 +617,7 @@ VstInt32 pdvst::getChunk (void** data, bool isPreset)
VstInt32 pdvst::setChunk (void* data, VstInt32 byteSize, bool isPreset) VstInt32 pdvst::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{ {
MessageBox(NULL,"debug","setchunk",MB_OK); //MessageBox(NULL,"debug","setchunk",MB_OK);
WaitForSingleObject(pdvstTransferMutex, 10); WaitForSingleObject(pdvstTransferMutex, 10);
{ {
pdvstData->datachunk.direction = PD_RECEIVE; pdvstData->datachunk.direction = PD_RECEIVE;

View File

@ -44,6 +44,7 @@ bool globalCustomGui = false;
int globalCustomGuiWidth= 320; int globalCustomGuiWidth= 320;
int globalCustomGuiHeight= 150; int globalCustomGuiHeight= 150;
pdvstProgram globalProgram[MAXPROGRAMS]; pdvstProgram globalProgram[MAXPROGRAMS];
bool globalProgramsAreChunks = false;
char *trimWhitespace(char *str); char *trimWhitespace(char *str);
void parseSetupFile(); void parseSetupFile();
@ -376,6 +377,18 @@ void parseSetupFile()
globalProgram[progNum].paramValue[paramNum] = \ globalProgram[progNum].paramValue[paramNum] = \
(float)atof(value); (float)atof(value);
} }
// programsarechunks (save custom data in .fxb file)
if (strcmp(param, "programsarechunks") == 0)
{
if (strcmp(strlwr(value), "true") == 0)
{
globalProgramsAreChunks = true;
}
else if (strcmp(strlwr(value), "false") == 0)
{
globalProgramsAreChunks = false;
}
}
} }
} }
} }