Skip to content

Commit

Permalink
don't write AutoConnection to file in initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
vsicurella committed Jun 3, 2024
1 parent 14dc61e commit fd8c7ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Source/MidiEditArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/MidiEditArea.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit fd8c7ce

Please sign in to comment.