From fd8c7ce82cfa86e361b742172d92ff7feb0c13a2 Mon Sep 17 00:00:00 2001 From: Vincenzo Sicurella Date: Sun, 2 Jun 2024 22:55:24 -0400 Subject: [PATCH] don't write AutoConnection to file in initialization --- Source/MidiEditArea.cpp | 7 ++++--- Source/MidiEditArea.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) 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();