diff --git a/Source/LumatoneEditorState.cpp b/Source/LumatoneEditorState.cpp index c2c16b4..164d717 100644 --- a/Source/LumatoneEditorState.cpp +++ b/Source/LumatoneEditorState.cpp @@ -454,7 +454,7 @@ bool LumatoneEditorState::Controller::resetToCurrentFile() // Add file to recent files list editorState.recentFiles->addFile(editorState.currentFile); - getEditorListeners()->call(&LumatoneEditor::EditorListener::newFileLoaded, editorState.getCurrentFile()); + // getEditorListeners()->call(&LumatoneEditor::EditorListener::newFileLoaded, editorState.getCurrentFile()); return true; } diff --git a/Source/MainWindow.cpp b/Source/MainWindow.cpp index c24c9a8..403123d 100644 --- a/Source/MainWindow.cpp +++ b/Source/MainWindow.cpp @@ -214,16 +214,23 @@ void MainWindow::updateTitle() setName(windowTitle); } -void MainWindow::newFileLoaded(juce::File file) -{ - updateTitle(); -} +// void MainWindow::layoutChanged(const LumatoneLayout &mappingData) +// { +// updateTitle(); +// } + +// void MainWindow::newFileLoaded(juce::File file) +// { +// updateTitle(); +// } void MainWindow::handleStatePropertyChange(juce::ValueTree stateIn, const juce::Identifier &property) { LumatoneEditorState::handleStatePropertyChange(stateIn, property); - if (property == LumatoneEditorProperty::HasChangesToSave) + if (property == LumatoneEditorProperty::HasChangesToSave + || property == LumatoneEditorProperty::CurrentFile + ) { updateTitle(); } diff --git a/Source/MainWindow.h b/Source/MainWindow.h index d8567cb..87e777d 100644 --- a/Source/MainWindow.h +++ b/Source/MainWindow.h @@ -77,7 +77,8 @@ class MainWindow : public juce::DocumentWindow void updateTitle(); // LumatoneEditor::EditorListener implementation - void newFileLoaded(juce::File file) override; + // void newFileLoaded(juce::File file) override; + // void layoutChanged(const LumatoneLayout& mappingData) override; private: diff --git a/Source/lumatone_editor_library/data/application_state.cpp b/Source/lumatone_editor_library/data/application_state.cpp index a974114..12b1b85 100644 --- a/Source/lumatone_editor_library/data/application_state.cpp +++ b/Source/lumatone_editor_library/data/application_state.cpp @@ -248,7 +248,7 @@ void LumatoneApplicationState::setCompleteConfig(const LumatoneLayout &layoutIn) controller->sendCurrentCompleteConfig(); } - editorListeners->call(&LumatoneEditor::EditorListener::completeMappingLoaded, *mappingData); + editorListeners->call(&LumatoneEditor::EditorListener::layoutChanged, *mappingData); editorListeners->call(&LumatoneEditor::EditorListener::expressionPedalSensitivityChanged, getExpressionSensitivity()); editorListeners->call(&LumatoneEditor::EditorListener::invertFootControllerChanged, getInvertExpression()); editorListeners->call(&LumatoneEditor::EditorListener::lightOnKeyStrokesChanged, getLightOnKeyStrokes()); @@ -269,7 +269,7 @@ void LumatoneApplicationState::setLayout(const LumatoneLayout &layoutIn) controller->sendCompleteMapping(layoutIn); } - editorListeners->call(&LumatoneEditor::EditorListener::completeMappingLoaded, *mappingData); + editorListeners->call(&LumatoneEditor::EditorListener::layoutChanged, *mappingData); } void LumatoneApplicationState::setBoard(const LumatoneBoard &boardIn, int boardId) diff --git a/Source/lumatone_editor_library/listeners/editor_listener.h b/Source/lumatone_editor_library/listeners/editor_listener.h index a861939..5bf63c2 100644 --- a/Source/lumatone_editor_library/listeners/editor_listener.h +++ b/Source/lumatone_editor_library/listeners/editor_listener.h @@ -14,13 +14,13 @@ class EditorListener virtual ~EditorListener() {} // App Actions - virtual void completeMappingLoaded(const LumatoneLayout& mappingData) {} + virtual void layoutChanged(const LumatoneLayout& mappingData) {} virtual void boardChanged(const LumatoneBoard& boardData) {} virtual void keyChanged(int boardIndex, int keyIndex, const LumatoneKey& lumatoneKey) {} virtual void keySetChanged(juce::Array selection) {} - virtual void newFileLoaded(juce::File file) {} + // virtual void newFileLoaded(juce::File file) {} //virtual void tableChanged(LumatoneConfigTable::TableType type, const juce::uint8* table, int tableSize) {} @@ -91,7 +91,7 @@ class LayoutChangeListener : public EditorListener protected: - virtual void completeMappingLoaded(const LumatoneLayout& mappingData) + virtual void layoutChanged(const LumatoneLayout& mappingData) { layoutWasUpdated(); } diff --git a/Source/lumatone_editor_library/ui/keyboard_component.cpp b/Source/lumatone_editor_library/ui/keyboard_component.cpp index 915814e..837a14a 100644 --- a/Source/lumatone_editor_library/ui/keyboard_component.cpp +++ b/Source/lumatone_editor_library/ui/keyboard_component.cpp @@ -24,7 +24,7 @@ LumatoneKeyboardComponent::LumatoneKeyboardComponent(const LumatoneApplicationSt addKeyListener(this); setWantsKeyboardFocus(true); - completeMappingLoaded(*getMappingData()); + layoutChanged(*getMappingData()); updateSelectedKeys(*getSelectedKeys()); addEditorListener(this); @@ -191,7 +191,7 @@ void LumatoneKeyboardComponent::setUiMode(LumatoneKeyboardComponent::UiMode mode uiMode = modeIn; } -void LumatoneKeyboardComponent::completeMappingLoaded(const LumatoneLayout& mappingData) +void LumatoneKeyboardComponent::layoutChanged(const LumatoneLayout& mappingData) { for (int boardIndex = 0; boardIndex < octaveBoards.size(); boardIndex++) { diff --git a/Source/lumatone_editor_library/ui/keyboard_component.h b/Source/lumatone_editor_library/ui/keyboard_component.h index 65dd263..8298627 100644 --- a/Source/lumatone_editor_library/ui/keyboard_component.h +++ b/Source/lumatone_editor_library/ui/keyboard_component.h @@ -80,7 +80,7 @@ class LumatoneKeyboardComponent : public juce::Component, public: // LumatoneEditor::EditorListener Implementation - void completeMappingLoaded(const LumatoneLayout& mappingData) override; + void layoutChanged(const LumatoneLayout& mappingData) override; void boardChanged(const LumatoneBoard& boardData) override; void contextChanged(LumatoneContext* newOrEmptyContext) override; void keyChanged(int boardIndex, int keyIndex, const LumatoneKey& lumatoneKey) override; diff --git a/Source/mapping_editors/MultiSelectControls.cpp b/Source/mapping_editors/MultiSelectControls.cpp index 2e4b7e7..6baa51a 100644 --- a/Source/mapping_editors/MultiSelectControls.cpp +++ b/Source/mapping_editors/MultiSelectControls.cpp @@ -202,7 +202,7 @@ void MultiSelectControls::resized() channelInput->setBounds(noteChannelColumnX, lblChannel->getBottom(), noteChannelColumnWidth, controlHeight); } -void MultiSelectControls::completeMappingLoaded(const LumatoneLayout &mappingData) +void MultiSelectControls::layoutChanged(const LumatoneLayout &mappingData) { auto layoutColours = mappingData.getLayoutColours(); colourDropdown->setColourOptions(layoutColours); @@ -220,7 +220,7 @@ void MultiSelectControls::boardChanged(const LumatoneBoard &boardData) // colourDropdown->addItem(colour.toDisplayString(false), colourDropdown->getNumItems() + 1); // } - completeMappingLoaded(*getMappingData()); + layoutChanged(*getMappingData()); } void MultiSelectControls::keyChanged(int boardIndex, int keyIndex, const LumatoneKey &lumatoneKey) @@ -228,7 +228,7 @@ void MultiSelectControls::keyChanged(int boardIndex, int keyIndex, const Lumaton // auto colourOptions = colourDropdown->getColourOptions(); // if (!colourOptions.contains(lumatoneKey.getColour())) // colourDropdown->addItem(lumatoneKey.getColour().toDisplayString(false), colourDropdown->getNumItems() + 1); - completeMappingLoaded(*getMappingData()); + layoutChanged(*getMappingData()); } void MultiSelectControls::keySetChanged(juce::Array selection) @@ -241,5 +241,5 @@ void MultiSelectControls::keySetChanged(juce::Array selection // colourDropdown->addItem(key.getColour().toDisplayString(false), colourDropdown->getNumItems() + 1); // } - completeMappingLoaded(*getMappingData()); + layoutChanged(*getMappingData()); } diff --git a/Source/mapping_editors/MultiSelectControls.h b/Source/mapping_editors/MultiSelectControls.h index 83ee478..15c8c6b 100644 --- a/Source/mapping_editors/MultiSelectControls.h +++ b/Source/mapping_editors/MultiSelectControls.h @@ -34,7 +34,7 @@ class MultiSelectControls : public LumatoneEditorState void resized() override; private: - void completeMappingLoaded(const LumatoneLayout& mappingData) override; + void layoutChanged(const LumatoneLayout& mappingData) override; void boardChanged(const LumatoneBoard& boardData) override; void keyChanged(int boardIndex, int keyIndex, const LumatoneKey& lumatoneKey) override; void keySetChanged(juce::Array selection) override;