From 4a9db1e6374a68ab1bc0c5fd3035b10056b23f59 Mon Sep 17 00:00:00 2001 From: vsicurella Date: Sat, 22 Jun 2019 19:12:48 -0400 Subject: [PATCH] I think i fixed it? --- Source/PluginState.cpp | 22 ++++++++++++---------- Source/PresetManager.cpp | 2 ++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Source/PluginState.cpp b/Source/PluginState.cpp index ab806d9..d958cf1 100644 --- a/Source/PluginState.cpp +++ b/Source/PluginState.cpp @@ -41,8 +41,8 @@ SvkPluginState::SvkPluginState() textFilterIntOrSpace.reset(new TextFilterIntOrSpace()); textFilterInt.reset(new TextFilterInt()); - loadMode(8); - presetWorking = SvkPreset(*presetManager->getPresetLoaded()); + updatePluginToPresetLoaded(); + //presetWorking = SvkPreset(*presetManager->getPresetLoaded()); } SvkMidiProcessor* SvkPluginState::getMidiProcessor() @@ -106,32 +106,34 @@ void SvkPluginState::setMidiRootNote(int rootNoteIn) void SvkPluginState::updatePluginToPresetLoaded() { - + DBG("Loading this preset:"); presetWorking = SvkPreset(*presetManager->getPresetLoaded()); presetEdited = false; - midiProcessor->setMidiMaps(presetWorking.theModeNode); + DBG(presetWorking.parentNode.toXmlString()); + + midiProcessor->setMidiMaps(presetWorking.theMapNode); - modeLoaded->restoreNode(presetManager->presetNode, false); + modeLoaded->restoreNode(presetWorking.theModeNode, false); virtualKeyboard->applyMode(modeLoaded.get()); midiProcessor->setScaleSize(modeLoaded->getScaleSize()); - - sendChangeMessage(); } void SvkPluginState::updatePluginFromParentNode() { presetManager->loadPreset(modePresetNode, false); - midiProcessor->restoreFromNode(midiSettingsNode); + presetWorking = SvkPreset(*presetManager->getPresetLoaded()); + presetEdited = false; + + midiProcessor->restoreFromNode(presetWorking.theMapNode); modeLoaded->restoreNode(modePresetNode, false); virtualKeyboard->applyMode(modeLoaded.get()); midiProcessor->setScaleSize(modeLoaded->getScaleSize()); - presetWorking = SvkPreset(*presetManager->getPresetLoaded()); - presetEdited = false; + sendChangeMessage(); } diff --git a/Source/PresetManager.cpp b/Source/PresetManager.cpp index 7c93ca0..4f7c4fb 100644 --- a/Source/PresetManager.cpp +++ b/Source/PresetManager.cpp @@ -208,6 +208,8 @@ void SvkPresetManager::intializePresets() createFactoryPresets(); loadPresetDirectory(); buildPresetMenu(); + + loadPreset(8); }