Skip to content

Commit

Permalink
I think i fixed it?
Browse files Browse the repository at this point in the history
  • Loading branch information
vsicurella committed Jun 22, 2019
1 parent dedf64f commit 4a9db1e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Source/PluginState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions Source/PresetManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ void SvkPresetManager::intializePresets()
createFactoryPresets();
loadPresetDirectory();
buildPresetMenu();

loadPreset(8);
}


Expand Down

0 comments on commit 4a9db1e

Please sign in to comment.