From fb24f42f0f393b0eb3feacbb3a9db9be38dfb355 Mon Sep 17 00:00:00 2001 From: Vincenzo Sicurella Date: Thu, 1 Aug 2024 21:39:07 -0400 Subject: [PATCH] demote LumatoneController from changing application state (wip) --- .../device/lumatone_controller.cpp | 13 +++---------- .../device/lumatone_controller.h | 4 +--- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Source/lumatone_editor_library/device/lumatone_controller.cpp b/Source/lumatone_editor_library/device/lumatone_controller.cpp index d7ef082..e288f80 100644 --- a/Source/lumatone_editor_library/device/lumatone_controller.cpp +++ b/Source/lumatone_editor_library/device/lumatone_controller.cpp @@ -15,19 +15,14 @@ #include "../listeners/editor_listener.h" LumatoneController::LumatoneController(const LumatoneApplicationState& stateIn, LumatoneFirmwareDriver& driverIn) - : LumatoneApplicationState("LumatoneController", stateIn) - , LumatoneApplicationState::DeviceController(static_cast(*this)) + : LumatoneState("LumatoneController", stateIn) , LumatoneApplicationMidiController(stateIn, driverIn) , firmwareDriver(driverIn) , updateBuffer(driverIn, stateIn) // , LumatoneSandboxLogger("LumatoneController") { - firmwareDriver.addDriverListener(this); - eventManager = std::make_unique(firmwareDriver, stateIn); eventManager->addFirmwareListener(this); - - addStatusListener(this); } LumatoneController::~LumatoneController() @@ -37,7 +32,7 @@ LumatoneController::~LumatoneController() juce::ValueTree LumatoneController::loadStateProperties(juce::ValueTree stateIn) { - LumatoneApplicationState::loadStateProperties(stateIn); + LumatoneState::loadStateProperties(stateIn); return state; } @@ -115,8 +110,6 @@ void LumatoneController::sendCompleteMapping(const LumatoneLayout& mappingData, { for (int boardId = 1; boardId <= getNumBoards(); boardId++) sendAllParamsOfBoard(boardId, &mappingData.getBoard(boardId - 1), false, bufferKeyUpdates); - - clearContext(); } void LumatoneController::sendCurrentCompleteConfig(bool signalEditorListeners) @@ -590,7 +583,7 @@ void LumatoneController::onConnectionConfirmed() void LumatoneController::handleStatePropertyChange(juce::ValueTree stateIn, const juce::Identifier &property) { - LumatoneApplicationState::handleStatePropertyChange(stateIn, property); + LumatoneState::handleStatePropertyChange(stateIn, property); if (waitingForFirmwareVersion && property == LumatoneStateProperty::LastConnectedFirmwareVersion) { diff --git a/Source/lumatone_editor_library/device/lumatone_controller.h b/Source/lumatone_editor_library/device/lumatone_controller.h index 53f7cd0..2e55962 100644 --- a/Source/lumatone_editor_library/device/lumatone_controller.h +++ b/Source/lumatone_editor_library/device/lumatone_controller.h @@ -26,10 +26,8 @@ class LumatoneAction; // Helper class for parsing and comparing (todo) firmware versions -class LumatoneController : private LumatoneApplicationState - , private LumatoneApplicationState::DeviceController +class LumatoneController : private LumatoneState , public LumatoneApplicationMidiController - , public LumatoneEditor::StatusListener , protected LumatoneEditor::FirmwareListener // , private LumatoneSandboxLogger {