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); }