commit
a57360d261
3 changed files with 53 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -318,3 +318,4 @@ __pycache__/
|
||||||
*.odx.cs
|
*.odx.cs
|
||||||
*.xsd.cs
|
*.xsd.cs
|
||||||
*.exe
|
*.exe
|
||||||
|
Source/Images/appIcon.png
|
||||||
|
|
26
OB-Xd.jucer
26
OB-Xd.jucer
|
@ -137,8 +137,7 @@
|
||||||
<MODULEPATH id="juce_audio_basics" path="modules"/>
|
<MODULEPATH id="juce_audio_basics" path="modules"/>
|
||||||
</MODULEPATHS>
|
</MODULEPATHS>
|
||||||
</VS2013>
|
</VS2013>
|
||||||
<VS2019 targetFolder="Builds/VisualStudio2019" smallIcon="nnY63W" bigIcon="nnY63W"
|
<VS2019 targetFolder="Builds/VisualStudio2019" smallIcon="nnY63W" bigIcon="nnY63W">
|
||||||
vst3Folder="modules/vstsdk3">
|
|
||||||
<CONFIGURATIONS>
|
<CONFIGURATIONS>
|
||||||
<CONFIGURATION isDebug="1" name="Debug" useRuntimeLibDLL="0"/>
|
<CONFIGURATION isDebug="1" name="Debug" useRuntimeLibDLL="0"/>
|
||||||
<CONFIGURATION isDebug="0" name="Release32" useRuntimeLibDLL="0" winArchitecture="Win32"/>
|
<CONFIGURATION isDebug="0" name="Release32" useRuntimeLibDLL="0" winArchitecture="Win32"/>
|
||||||
|
@ -160,6 +159,28 @@
|
||||||
<MODULEPATH id="juce_audio_basics"/>
|
<MODULEPATH id="juce_audio_basics"/>
|
||||||
</MODULEPATHS>
|
</MODULEPATHS>
|
||||||
</VS2019>
|
</VS2019>
|
||||||
|
<VS2017 targetFolder="Builds/VisualStudio2017">
|
||||||
|
<CONFIGURATIONS>
|
||||||
|
<CONFIGURATION isDebug="1" name="Debug"/>
|
||||||
|
<CONFIGURATION isDebug="0" name="Release32" winArchitecture="Win32"/>
|
||||||
|
<CONFIGURATION isDebug="0" name="Release64" winArchitecture="x64"/>
|
||||||
|
</CONFIGURATIONS>
|
||||||
|
<MODULEPATHS>
|
||||||
|
<MODULEPATH id="juce_opengl"/>
|
||||||
|
<MODULEPATH id="juce_gui_extra"/>
|
||||||
|
<MODULEPATH id="juce_gui_basics"/>
|
||||||
|
<MODULEPATH id="juce_graphics"/>
|
||||||
|
<MODULEPATH id="juce_events"/>
|
||||||
|
<MODULEPATH id="juce_data_structures"/>
|
||||||
|
<MODULEPATH id="juce_core"/>
|
||||||
|
<MODULEPATH id="juce_audio_utils"/>
|
||||||
|
<MODULEPATH id="juce_audio_processors"/>
|
||||||
|
<MODULEPATH id="juce_audio_plugin_client"/>
|
||||||
|
<MODULEPATH id="juce_audio_formats"/>
|
||||||
|
<MODULEPATH id="juce_audio_devices"/>
|
||||||
|
<MODULEPATH id="juce_audio_basics"/>
|
||||||
|
</MODULEPATHS>
|
||||||
|
</VS2017>
|
||||||
</EXPORTFORMATS>
|
</EXPORTFORMATS>
|
||||||
<MODULES>
|
<MODULES>
|
||||||
<MODULES id="juce_audio_basics" showAllCode="1" useLocalCopy="1"/>
|
<MODULES id="juce_audio_basics" showAllCode="1" useLocalCopy="1"/>
|
||||||
|
@ -179,5 +200,6 @@
|
||||||
<JUCEOPTIONS JUCE_QUICKTIME="disabled"/>
|
<JUCEOPTIONS JUCE_QUICKTIME="disabled"/>
|
||||||
<LIVE_SETTINGS>
|
<LIVE_SETTINGS>
|
||||||
<OSX/>
|
<OSX/>
|
||||||
|
<WINDOWS/>
|
||||||
</LIVE_SETTINGS>
|
</LIVE_SETTINGS>
|
||||||
</JUCERPROJECT>
|
</JUCERPROJECT>
|
||||||
|
|
|
@ -734,6 +734,7 @@ void ObxdAudioProcessor::getStateInformation (MemoryBlock& destData)
|
||||||
{
|
{
|
||||||
XmlElement* xpr = new XmlElement("program");
|
XmlElement* xpr = new XmlElement("program");
|
||||||
xpr->setAttribute(S("programName"), programs.programs[i].name);
|
xpr->setAttribute(S("programName"), programs.programs[i].name);
|
||||||
|
xpr->setAttribute(S("voiceCount"), Motherboard::MAX_VOICES);
|
||||||
|
|
||||||
for (int k = 0; k < PARAM_COUNT; ++k)
|
for (int k = 0; k < PARAM_COUNT; ++k)
|
||||||
{
|
{
|
||||||
|
@ -753,9 +754,25 @@ void ObxdAudioProcessor::getStateInformation (MemoryBlock& destData)
|
||||||
copyXmlToBinary(xmlState,destData);
|
copyXmlToBinary(xmlState,destData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObxdAudioProcessor::getCurrentProgramStateInformation(MemoryBlock& destData)
|
||||||
|
{
|
||||||
|
XmlElement xmlState = XmlElement("Datsounds");
|
||||||
|
|
||||||
|
for (int k = 0; k < PARAM_COUNT; ++k)
|
||||||
|
{
|
||||||
|
xmlState.setAttribute(String(k), programs.currentProgramPtr->values[k]);
|
||||||
|
}
|
||||||
|
|
||||||
|
xmlState.setAttribute(S("voiceCount"), Motherboard::MAX_VOICES);
|
||||||
|
xmlState.setAttribute(S("programName"), programs.currentProgramPtr->name);
|
||||||
|
|
||||||
|
copyXmlToBinary(xmlState, destData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ObxdAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
|
void ObxdAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
|
||||||
{
|
{
|
||||||
if (XmlElement* const xmlState = getXmlFromBinary(data,sizeInBytes))
|
if (std::unique_ptr<XmlElement> xmlState = getXmlFromBinary(data,sizeInBytes))
|
||||||
{
|
{
|
||||||
XmlElement* xprogs = xmlState->getFirstChildElement();
|
XmlElement* xprogs = xmlState->getFirstChildElement();
|
||||||
if (xprogs->hasTagName(S("programs")))
|
if (xprogs->hasTagName(S("programs")))
|
||||||
|
@ -763,11 +780,14 @@ void ObxdAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
forEachXmlChildElement(*xprogs, e)
|
forEachXmlChildElement(*xprogs, e)
|
||||||
{
|
{
|
||||||
|
bool newFormat = e->hasAttribute("voiceCount");
|
||||||
programs.programs[i].setDefaultValues();
|
programs.programs[i].setDefaultValues();
|
||||||
|
|
||||||
for (int k = 0; k < PARAM_COUNT; ++k)
|
for (int k = 0; k < PARAM_COUNT; ++k)
|
||||||
{
|
{
|
||||||
programs.programs[i].values[k] = e->getDoubleAttribute(String(k), programs.programs[i].values[k]);
|
float value = float(e->getDoubleAttribute(String(k), programs.programs[i].values[k]));
|
||||||
|
if (!newFormat && k == VOICE_COUNT) value *= 0.25f;
|
||||||
|
programs.programs[i].values[k] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
programs.programs[i].name = e->getStringAttribute(S("programName"), S("Default"));
|
programs.programs[i].name = e->getStringAttribute(S("programName"), S("Default"));
|
||||||
|
@ -789,13 +809,16 @@ void ObxdAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
|
||||||
|
|
||||||
void ObxdAudioProcessor::setCurrentProgramStateInformation(const void* data,int sizeInBytes)
|
void ObxdAudioProcessor::setCurrentProgramStateInformation(const void* data,int sizeInBytes)
|
||||||
{
|
{
|
||||||
if (XmlElement* const e = getXmlFromBinary(data, sizeInBytes))
|
if (std::unique_ptr<XmlElement> e = getXmlFromBinary(data, sizeInBytes))
|
||||||
{
|
{
|
||||||
programs.currentProgramPtr->setDefaultValues();
|
programs.currentProgramPtr->setDefaultValues();
|
||||||
|
|
||||||
|
bool newFormat = e->hasAttribute("voiceCount");
|
||||||
for (int k = 0; k < PARAM_COUNT; ++k)
|
for (int k = 0; k < PARAM_COUNT; ++k)
|
||||||
{
|
{
|
||||||
programs.currentProgramPtr->values[k] = e->getDoubleAttribute(String(k), programs.currentProgramPtr->values[k]);
|
float value = float(e->getDoubleAttribute(String(k), programs.currentProgramPtr->values[k]));
|
||||||
|
if (!newFormat && k == VOICE_COUNT) value *= 0.25f;
|
||||||
|
programs.currentProgramPtr->values[k] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
programs.currentProgramPtr->name = e->getStringAttribute(S("programName"), S("Default"));
|
programs.currentProgramPtr->name = e->getStringAttribute(S("programName"), S("Default"));
|
||||||
|
@ -820,6 +843,7 @@ void ObxdAudioProcessor::getCurrentProgramStateInformation(MemoryBlock& destData
|
||||||
copyXmlToBinary(xmlState, destData);
|
copyXmlToBinary(xmlState, destData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
bool ObxdAudioProcessor::loadFromFXBFile(const File& fxbFile)
|
bool ObxdAudioProcessor::loadFromFXBFile(const File& fxbFile)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue