diff --git a/Source/MidiEditArea.cpp b/Source/MidiEditArea.cpp index 8aacb10..217ad12 100644 --- a/Source/MidiEditArea.cpp +++ b/Source/MidiEditArea.cpp @@ -184,7 +184,7 @@ MidiEditArea::MidiEditArea (const LumatoneEditorState& stateIn) // btnAutoConnect->setToggleState(isAutoConnectionEnabled(), sendNotificationSync); bool enableAutoConnection = getBoolProperty(LumatoneEditorProperty::AutoConnectDevice, true); btnAutoConnect->setToggleState(enableAutoConnection, dontSendNotification); - onAutoConnectionChanged(); + onAutoConnectionChanged(false); } MidiEditArea::~MidiEditArea() @@ -380,12 +380,13 @@ void MidiEditArea::setConnectivity(bool isConnectedIn, juce::String connectionSt resized(); } -void MidiEditArea::onAutoConnectionChanged() +void MidiEditArea::onAutoConnectionChanged(bool writeToPropertiesFile) { bool isAuto = btnAutoConnect->getToggleState(); bool isNotAuto = !isAuto; - savePropertyBoolValue(LumatoneEditorProperty::AutoConnectDevice, isAuto); + if (writeToPropertiesFile) + savePropertyBoolValue(LumatoneEditorProperty::AutoConnectDevice, isAuto); cbMidiInput->setVisible(isNotAuto); cbMidiOutput->setVisible(isNotAuto); diff --git a/Source/MidiEditArea.h b/Source/MidiEditArea.h index f58c62b..5041a58 100644 --- a/Source/MidiEditArea.h +++ b/Source/MidiEditArea.h @@ -77,7 +77,7 @@ class MidiEditArea : public juce::Component private: void setConnectivity(bool isConnected, juce::String connectionStatus=String()); - void onAutoConnectionChanged(); + void onAutoConnectionChanged(bool writeToPropertiesFile=true); void editModeChangedCallback();