diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index b8bb2514..6a94565d 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -73,10 +73,10 @@ jobs: juce_style: FALSE installer_name: "" installer_dir: clapfirst - - name: Juce Style - juce_style: TRUE - installer_name: "OldJuceStyle-" - installer_dir: jucestyle + #- name: Juce Style + # juce_style: TRUE + # installer_name: "OldJuceStyle-" + # installer_dir: jucestyle steps: - name: Checkout code diff --git a/clients/clap-first/scxt-juce-standalone/scxt-juce-standalone.cpp b/clients/clap-first/scxt-juce-standalone/scxt-juce-standalone.cpp index 105df5df..c68038c2 100644 --- a/clients/clap-first/scxt-juce-standalone/scxt-juce-standalone.cpp +++ b/clients/clap-first/scxt-juce-standalone/scxt-juce-standalone.cpp @@ -38,7 +38,7 @@ #include "version.h" #include "engine/engine.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "sst/voicemanager/midi1_to_voicemanager.h" using namespace juce; @@ -52,7 +52,8 @@ struct SCXTApplicationWindow : juce::DocumentWindow, juce::Button::Listener void paint(juce::Graphics &g) override { g.fillAll(juce::Colours::red); } void resized() override { - onto.setBounds(0, 0, scxt::ui::SCXTEditor::edWidth, scxt::ui::SCXTEditor::edHeight); + onto.setBounds(0, 0, scxt::ui::app::SCXTEditor::edWidth, + scxt::ui::app::SCXTEditor::edHeight); } }; SCXTApplicationWindow() @@ -65,15 +66,15 @@ struct SCXTApplicationWindow : juce::DocumentWindow, juce::Button::Listener engine = std::make_unique(); engine->runningEnvironment = "Temporary SCXT Standalone"; - editor = std::make_unique( + editor = std::make_unique( *(engine->getMessageController()), *(engine->defaults), *(engine->getSampleManager()), *(engine->getBrowser()), engine->sharedUIMemoryState); editorHolder = std::make_unique(*editor); editor->onZoomChanged = [this](auto f) { - this->setSize(scxt::ui::SCXTEditor::edWidth * f, - scxt::ui::SCXTEditor::edHeight * f + getTitleBarHeight()); + this->setSize(scxt::ui::app::SCXTEditor::edWidth * f, + scxt::ui::app::SCXTEditor::edHeight * f + getTitleBarHeight()); }; - editor->setSize(scxt::ui::SCXTEditor::edWidth, scxt::ui::SCXTEditor::edHeight); + editor->setSize(scxt::ui::app::SCXTEditor::edWidth, scxt::ui::app::SCXTEditor::edHeight); Component::addAndMakeVisible(*editorHolder); setTitleBarButtonsRequired(DocumentWindow::minimiseButton | DocumentWindow::closeButton, @@ -302,7 +303,7 @@ struct SCXTApplicationWindow : juce::DocumentWindow, juce::Button::Listener AudioDeviceManager deviceManager; std::unique_ptr engine; - std::unique_ptr editor; + std::unique_ptr editor; std::unique_ptr properties; std::unique_ptr editorHolder; }; diff --git a/clients/clap-first/scxt-plugin/scxt-plugin.cpp b/clients/clap-first/scxt-plugin/scxt-plugin.cpp index 2077445a..90567349 100644 --- a/clients/clap-first/scxt-plugin/scxt-plugin.cpp +++ b/clients/clap-first/scxt-plugin/scxt-plugin.cpp @@ -29,7 +29,7 @@ #include "scxt-plugin.h" #include "version.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "sst/voicemanager/midi1_to_voicemanager.h" @@ -86,7 +86,7 @@ SCXTPlugin::~SCXTPlugin() std::unique_ptr SCXTPlugin::createEditor() { - auto ed = std::make_unique( + auto ed = std::make_unique( *(engine->getMessageController()), *(engine->defaults), *(engine->getSampleManager()), *(engine->getBrowser()), engine->sharedUIMemoryState); ed->onZoomChanged = [this](auto f) { @@ -94,15 +94,15 @@ std::unique_ptr SCXTPlugin::createEditor() { // SCLOG("On Zoom Changed with " << f << " - requesting resize of " << // scxt::ui::SCXTEditor::edWidth * f << "x" << scxt::ui::SCXTEditor::edHeight * f) - _host.guiRequestResize(scxt::ui::SCXTEditor::edWidth * f, - scxt::ui::SCXTEditor::edHeight * f); + _host.guiRequestResize(scxt::ui::app::SCXTEditor::edWidth * f, + scxt::ui::app::SCXTEditor::edHeight * f); } }; onShow = [e = ed.get()]() { e->setZoomFactor(e->zoomFactor); return true; }; - ed->setSize(scxt::ui::SCXTEditor::edWidth, scxt::ui::SCXTEditor::edHeight); + ed->setSize(scxt::ui::app::SCXTEditor::edWidth, scxt::ui::app::SCXTEditor::edHeight); return ed; } diff --git a/clients/juce-plugin/SCXTPluginEditor.cpp b/clients/juce-plugin/SCXTPluginEditor.cpp index c0679ae8..d043877a 100644 --- a/clients/juce-plugin/SCXTPluginEditor.cpp +++ b/clients/juce-plugin/SCXTPluginEditor.cpp @@ -27,7 +27,7 @@ #include "SCXTProcessor.h" #include "SCXTPluginEditor.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "engine/engine.h" //============================================================================== @@ -38,12 +38,12 @@ SCXTPluginEditor::SCXTPluginEditor(SCXTProcessor &p, scxt::messaging::MessageCon const scxt::engine::Engine::SharedUIMemoryState &st) : juce::AudioProcessorEditor(&p) { - ed = std::make_unique(mc, d, s, br, st); + ed = std::make_unique(mc, d, s, br, st); ed->onZoomChanged = [this](auto f) { - setSize(scxt::ui::SCXTEditor::edWidth * f, scxt::ui::SCXTEditor::edHeight * f); + setSize(scxt::ui::app::SCXTEditor::edWidth * f, scxt::ui::app::SCXTEditor::edHeight * f); }; addAndMakeVisible(*ed); - setSize(scxt::ui::SCXTEditor::edWidth, scxt::ui::SCXTEditor::edHeight); + setSize(scxt::ui::app::SCXTEditor::edWidth, scxt::ui::app::SCXTEditor::edHeight); ed->setBounds(0, 0, getWidth(), getHeight()); setResizable(false, false); } diff --git a/clients/juce-plugin/SCXTPluginEditor.h b/clients/juce-plugin/SCXTPluginEditor.h index 51047b33..8564cd6f 100644 --- a/clients/juce-plugin/SCXTPluginEditor.h +++ b/clients/juce-plugin/SCXTPluginEditor.h @@ -31,7 +31,7 @@ #include "SCXTProcessor.h" #include "engine/engine.h" #include "messaging/messaging.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "browser/browser.h" //============================================================================== @@ -50,7 +50,7 @@ class SCXTPluginEditor : public juce::AudioProcessorEditor void resized() override; private: - std::unique_ptr ed; + std::unique_ptr ed; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SCXTPluginEditor) }; diff --git a/src-ui/CMakeLists.txt b/src-ui/CMakeLists.txt index 01a46815..888bc408 100644 --- a/src-ui/CMakeLists.txt +++ b/src-ui/CMakeLists.txt @@ -1,38 +1,36 @@ project(scxt-ui LANGUAGES CXX) add_library(${PROJECT_NAME} STATIC - - components/SCXTEditor.cpp - components/SCXTEditorMenus.cpp - components/SCXTEditorResponseHandlers.cpp - - components/HasEditor.cpp - - components/HeaderRegion.cpp - components/MixerScreen.cpp - components/MultiScreen.cpp - components/SendFXScreen.cpp - components/AboutScreen.cpp - components/PlayScreen.cpp - components/LogScreen.cpp - components/WelcomeScreen.cpp - - components/browser/BrowserPane.cpp - - components/mixer/BusPane.cpp - components/mixer/PartEffectsPane.cpp - components/mixer/ChannelStrip.cpp - - components/multi/AdsrPane.cpp - components/multi/LFOPane.cpp - components/multi/MappingPane.cpp - components/multi/ModPane.cpp - components/multi/OutputPane.cpp - components/multi/PartGroupSidebar.cpp - components/multi/PartSidebarCard.cpp - components/multi/ProcessorPane.cpp - components/multi/ProcessorPaneEQsFilters.cpp - components/multi/SingleMacroEditor.cpp + app/browser-ui/BrowserPane.cpp + + app/editor-impl/HasEditor.cpp + app/editor-impl/SCXTEditor.cpp + app/editor-impl/SCXTEditorMenus.cpp + app/editor-impl/SCXTEditorResponseHandlers.cpp + + app/edit-screen/EditScreen.cpp + app/edit-screen/components/AdsrPane.cpp + app/edit-screen/components/LFOPane.cpp + app/edit-screen/components/MappingPane.cpp + app/edit-screen/components/ModPane.cpp + app/edit-screen/components/OutputPane.cpp + app/edit-screen/components/PartGroupSidebar.cpp + app/edit-screen/components/ProcessorPane.cpp + app/edit-screen/components/ProcessorPaneEQsFilters.cpp + + app/mixer-screen/MixerScreen.cpp + app/mixer-screen/components/BusPane.cpp + app/mixer-screen/components/ChannelStrip.cpp + app/mixer-screen/components/PartEffectsPane.cpp + + app/other-screens/AboutScreen.cpp + app/other-screens/LogScreen.cpp + app/other-screens/WelcomeScreen.cpp + app/play-screen/PlayScreen.cpp + + app/shared/HeaderRegion.cpp + app/shared/PartSidebarCard.cpp + app/shared/SingleMacroEditor.cpp connectors/SCXTResources.cpp connectors/JSONAssetSupport.cpp diff --git a/src-ui/components/HasEditor.h b/src-ui/app/HasEditor.h similarity index 97% rename from src-ui/components/HasEditor.h rename to src-ui/app/HasEditor.h index 5d61e7c2..99189283 100644 --- a/src-ui/components/HasEditor.h +++ b/src-ui/app/HasEditor.h @@ -32,7 +32,7 @@ #include #include -namespace scxt::ui +namespace scxt::ui::app { struct SCXTEditor; @@ -57,5 +57,5 @@ struct HasEditor template void setupWidgetForValueTooltip(const W &widget, const A &attachment); }; -} // namespace scxt::ui +} // namespace scxt::ui::app #endif // SHORTCIRCUIT_HASEDITOR_H diff --git a/src-ui/components/SCXTEditor.h b/src-ui/app/SCXTEditor.h similarity index 94% rename from src-ui/components/SCXTEditor.h rename to src-ui/app/SCXTEditor.h index 202ffb08..f2565485 100644 --- a/src-ui/components/SCXTEditor.h +++ b/src-ui/app/SCXTEditor.h @@ -32,7 +32,7 @@ #include #include -#include "SCXTJuceLookAndFeel.h" +#include "app/editor-impl/SCXTJuceLookAndFeel.h" #include "engine/engine.h" #include "engine/patch.h" #include "messaging/client/selection_messages.h" @@ -58,17 +58,31 @@ namespace sst::jucegui::components { struct HasDiscreteParamMenuBuilder; } -namespace scxt::ui +namespace scxt::ui::app { +namespace shared +{ struct HeaderRegion; -struct MultiScreen; +} +namespace edit_screen +{ +struct EditScreen; +} +namespace mixer_screen +{ struct MixerScreen; -struct AboutScreen; -struct WelcomeScreen; +} +namespace play_screen +{ struct PlayScreen; +} +namespace other_screens +{ +struct WelcomeScreen; +struct AboutScreen; struct LogScreen; -struct SCXTJuceLookAndFeel; +} // namespace other_screens struct SCXTEditor : sst::jucegui::components::WindowPanel, juce::DragAndDropContainer { @@ -121,13 +135,13 @@ struct SCXTEditor : sst::jucegui::components::WindowPanel, juce::DragAndDropCont }; std::unique_ptr idleTimer; - std::unique_ptr headerRegion; - std::unique_ptr multiScreen; - std::unique_ptr mixerScreen; - std::unique_ptr playScreen; - std::unique_ptr aboutScreen; - std::unique_ptr welcomeScreen; - std::unique_ptr logScreen; + std::unique_ptr headerRegion; + std::unique_ptr editScreen; + std::unique_ptr mixerScreen; + std::unique_ptr playScreen; + std::unique_ptr aboutScreen; + std::unique_ptr welcomeScreen; + std::unique_ptr logScreen; std::unique_ptr toolTip; @@ -325,6 +339,6 @@ inline void HasEditor::setupWidgetForValueTooltip(const W &w, const A &a) }; w->onIdleHoverEnd = [this]() { editor->hideTooltip(); }; } -} // namespace scxt::ui +} // namespace scxt::ui::app #endif // SCXT_SRC_UI_COMPONENTS_SCXTEDITOR_H diff --git a/src-ui/components/browser/BrowserPane.cpp b/src-ui/app/browser-ui/BrowserPane.cpp similarity index 99% rename from src-ui/components/browser/BrowserPane.cpp rename to src-ui/app/browser-ui/BrowserPane.cpp index f49b85ea..45949cba 100644 --- a/src-ui/components/browser/BrowserPane.cpp +++ b/src-ui/app/browser-ui/BrowserPane.cpp @@ -26,14 +26,14 @@ */ #include "BrowserPane.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "browser/browser.h" #include "sst/jucegui/components/Label.h" #include "sst/jucegui/components/NamedPanelDivider.h" #include "sst/jucegui/components/TextPushButton.h" #include "sst/plugininfra/strnatcmp.h" -namespace scxt::ui::browser +namespace scxt::ui::app::browser_ui { namespace jcmp = sst::jucegui::components; @@ -571,4 +571,4 @@ void BrowserPane::selectPane(int i) searchPane->setVisible(i == 2); repaint(); } -} // namespace scxt::ui::browser +} // namespace scxt::ui::app::browser_ui diff --git a/src-ui/components/browser/BrowserPane.h b/src-ui/app/browser-ui/BrowserPane.h similarity index 89% rename from src-ui/components/browser/BrowserPane.h rename to src-ui/app/browser-ui/BrowserPane.h index 27ccac7a..d0bf0e86 100644 --- a/src-ui/components/browser/BrowserPane.h +++ b/src-ui/app/browser-ui/BrowserPane.h @@ -33,16 +33,16 @@ #include #include -#include "components/HasEditor.h" +#include "app/HasEditor.h" #include "sst/jucegui/components/ToggleButtonRadioGroup.h" -namespace scxt::ui::browser +namespace scxt::ui::app::browser_ui // a bit clumsy to distinguis from scxt::browser { struct DevicesPane; struct FavoritesPane; struct SearchPane; -struct BrowserPane : public HasEditor, sst::jucegui::components::NamedPanel +struct BrowserPane : public app::HasEditor, sst::jucegui::components::NamedPanel { std::unique_ptr selectedFunction; std::unique_ptr selectedFunctionData; @@ -61,6 +61,6 @@ struct BrowserPane : public HasEditor, sst::jucegui::components::NamedPanel void selectPane(int); int selectedPane{0}; }; -} // namespace scxt::ui::browser +} // namespace scxt::ui::app::browser_ui #endif // SHORTCIRCUITXT_BROWSERPANE_H diff --git a/src-ui/components/MultiScreen.cpp b/src-ui/app/edit-screen/EditScreen.cpp similarity index 72% rename from src-ui/components/MultiScreen.cpp rename to src-ui/app/edit-screen/EditScreen.cpp index c9ee7240..5cfeeb0a 100644 --- a/src-ui/components/MultiScreen.cpp +++ b/src-ui/app/edit-screen/EditScreen.cpp @@ -25,22 +25,22 @@ * https://github.com/surge-synthesizer/shortcircuit-xt */ -#include "MultiScreen.h" -#include "browser/BrowserPane.h" -#include "multi/AdsrPane.h" -#include "multi/LFOPane.h" -#include "multi/MappingPane.h" -#include "multi/ModPane.h" -#include "multi/OutputPane.h" -#include "multi/ProcessorPane.h" -#include "multi/PartGroupSidebar.h" - -#include "SCXTEditor.h" - -namespace scxt::ui +#include "EditScreen.h" +#include "app/browser-ui/BrowserPane.h" +#include "app/edit-screen/components/AdsrPane.h" +#include "app/edit-screen/components/LFOPane.h" +#include "app/edit-screen/components/MappingPane.h" +#include "app/edit-screen/components/ModPane.h" +#include "app/edit-screen/components/OutputPane.h" +#include "app/edit-screen/components/ProcessorPane.h" +#include "app/edit-screen/components/PartGroupSidebar.h" + +#include "app/SCXTEditor.h" + +namespace scxt::ui::app::edit_screen { -static_assert(engine::processorCount == MultiScreen::numProcessorDisplays); +static_assert(engine::processorCount == EditScreen::numProcessorDisplays); struct DebugRect : public sst::jucegui::components::NamedPanel { @@ -67,16 +67,16 @@ struct DebugRect : public sst::jucegui::components::NamedPanel void resized() override { cl->setBounds(getContentArea()); } }; -MultiScreen::MultiScreen(SCXTEditor *e) : HasEditor(e) +EditScreen::EditScreen(SCXTEditor *e) : HasEditor(e) { - parts = std::make_unique(editor); - addAndMakeVisible(*parts); + partSidebar = std::make_unique(editor); + addAndMakeVisible(*partSidebar); - auto br = std::make_unique(editor); + auto br = std::make_unique(editor); browser = std::move(br); addAndMakeVisible(*browser); - sample = std::make_unique(editor); - addAndMakeVisible(*sample); + mappingPane = std::make_unique(editor); + addAndMakeVisible(*mappingPane); zoneElements = std::make_unique>(this); groupElements = std::make_unique>(this); @@ -84,32 +84,32 @@ MultiScreen::MultiScreen(SCXTEditor *e) : HasEditor(e) setSelectionMode(SelectionMode::ZONE); } -MultiScreen::~MultiScreen() = default; +EditScreen::~EditScreen() = default; -void MultiScreen::layout() +void EditScreen::layout() { - parts->setBounds(pad, pad, sideWidths, getHeight() - 3 * pad); + partSidebar->setBounds(pad, pad, sideWidths, getHeight() - 3 * pad); browser->setBounds(getWidth() - sideWidths - pad, pad, sideWidths, getHeight() - 3 * pad); auto mainRect = juce::Rectangle( sideWidths + 3 * pad, pad, getWidth() - 2 * sideWidths - 6 * pad, getHeight() - 3 * pad); auto wavHeight = mainRect.getHeight() - envHeight - modHeight - fxHeight; - sample->setBounds(mainRect.withHeight(wavHeight)); + mappingPane->setBounds(mainRect.withHeight(wavHeight)); zoneElements->layoutInto(mainRect); groupElements->layoutInto(mainRect); } -void MultiScreen::onVoiceInfoChanged() { sample->repaint(); } +void EditScreen::onVoiceInfoChanged() { mappingPane->repaint(); } -void MultiScreen::updateSamplePlaybackPosition(size_t sampleIndex, int64_t samplePos) +void EditScreen::updateSamplePlaybackPosition(size_t sampleIndex, int64_t samplePos) { - sample->updateSamplePlaybackPosition(sampleIndex, samplePos); + mappingPane->updateSamplePlaybackPosition(sampleIndex, samplePos); } -void MultiScreen::setSelectionMode(scxt::ui::MultiScreen::SelectionMode m) +void EditScreen::setSelectionMode(EditScreen::SelectionMode m) { if (selectionMode == m) return; @@ -137,18 +137,19 @@ void MultiScreen::setSelectionMode(scxt::ui::MultiScreen::SelectionMode m) } template -MultiScreen::ZoneOrGroupElements::ZoneOrGroupElements(MultiScreen *parent) +EditScreen::ZoneOrGroupElements::ZoneOrGroupElements(EditScreen *parent) { for (int i = 0; i < scxt::processorsPerZoneAndGroup; ++i) { - auto ff = std::make_unique(parent->editor, i, forZone); + auto ff = std::make_unique(parent->editor, i, forZone); ff->hasHamburger = true; processors[i] = std::move(ff); parent->addChildComponent(*(processors[i])); } - modPane = - std::make_unique>(parent->editor, forZone); - outPane = std::make_unique>(parent->editor); + modPane = std::make_unique>( + parent->editor, forZone); + outPane = + std::make_unique>(parent->editor); for (int i = 0; i < scxt::processorsPerZoneAndGroup; ++i) { outPane->addWeakProcessorPaneReference(i, @@ -160,11 +161,11 @@ MultiScreen::ZoneOrGroupElements::ZoneOrGroupElements(MultiScreen *pare for (int i = 0; i < scxt::egPerGroup; ++i) { - auto egt = std::make_unique(parent->editor, i, forZone); + auto egt = std::make_unique(parent->editor, i, forZone); eg[i] = std::move(egt); parent->addChildComponent(*eg[i]); } - lfo = std::make_unique(parent->editor, forZone); + lfo = std::make_unique(parent->editor, forZone); parent->addChildComponent(*lfo); auto &theme = parent->editor->themeApplier; @@ -197,9 +198,9 @@ MultiScreen::ZoneOrGroupElements::ZoneOrGroupElements(MultiScreen *pare } template -MultiScreen::ZoneOrGroupElements::~ZoneOrGroupElements() = default; +EditScreen::ZoneOrGroupElements::~ZoneOrGroupElements() = default; -template void MultiScreen::ZoneOrGroupElements::setVisible(bool b) +template void EditScreen::ZoneOrGroupElements::setVisible(bool b) { outPane->setVisible(b); lfo->setVisible(b); @@ -211,7 +212,7 @@ template void MultiScreen::ZoneOrGroupElements::setV } template -void MultiScreen::ZoneOrGroupElements::layoutInto(const juce::Rectangle &mainRect) +void EditScreen::ZoneOrGroupElements::layoutInto(const juce::Rectangle &mainRect) { auto wavHeight = mainRect.getHeight() - envHeight - modHeight - fxHeight; @@ -237,18 +238,18 @@ void MultiScreen::ZoneOrGroupElements::layoutInto(const juce::Rectangle lfo->setBounds(envRect.withWidth(ew * 2).translated(ew * 2, 0)); } -void MultiScreen::onOtherTabSelection() +void EditScreen::onOtherTabSelection() { auto pgz = editor->queryTabSelection(tabKey("multi.pgz")); if (pgz.empty()) { } else if (pgz == "part") - parts->setSelectedTab(0); + partSidebar->setSelectedTab(0); else if (pgz == "group") - parts->setSelectedTab(1); + partSidebar->setSelectedTab(1); else if (pgz == "zone") - parts->setSelectedTab(2); + partSidebar->setSelectedTab(2); else SCLOG("Unknown multi.pgz key " << pgz); @@ -271,10 +272,10 @@ void MultiScreen::onOtherTabSelection() { auto mt = std::atoi(mts.c_str()); if (mt >= 0 && mt < 3) - sample->setSelectedTab(mt); + mappingPane->setSelectedTab(mt); } } -template struct MultiScreen::ZoneOrGroupElements; -template struct MultiScreen::ZoneOrGroupElements; -} // namespace scxt::ui +template struct EditScreen::ZoneOrGroupElements; +template struct EditScreen::ZoneOrGroupElements; +} // namespace scxt::ui::app::edit_screen diff --git a/src-ui/components/MultiScreen.h b/src-ui/app/edit-screen/EditScreen.h similarity index 75% rename from src-ui/components/MultiScreen.h rename to src-ui/app/edit-screen/EditScreen.h index 8a73fe6c..83573744 100644 --- a/src-ui/components/MultiScreen.h +++ b/src-ui/app/edit-screen/EditScreen.h @@ -31,13 +31,18 @@ #include #include #include -#include "HasEditor.h" -#include "browser/BrowserPane.h" +#include "app/HasEditor.h" +#include "app/browser-ui/BrowserPane.h" #include "sst/jucegui/components/NamedPanel.h" -namespace scxt::ui +namespace scxt::ui::app { -namespace multi + +namespace browser_ui +{ +struct BrowserPane; +} +namespace edit_screen { struct AdsrPane; @@ -53,14 +58,7 @@ struct ModPaneGroupTraits; template struct ModPane; struct ProcessorPane; struct LfoPane; -} // namespace multi - -namespace browser -{ -struct BrowserPane; -} - -struct MultiScreen : juce::Component, HasEditor +struct EditScreen : juce::Component, HasEditor { static constexpr int numProcessorDisplays{4}; static constexpr int sideWidths = 196; // copied from mixer for now @@ -69,20 +67,20 @@ struct MultiScreen : juce::Component, HasEditor static constexpr int envHeight = 160, modHeight = 160, fxHeight = 176; static constexpr int pad = 0; - std::unique_ptr browser; - std::unique_ptr sample; - std::unique_ptr parts; + std::unique_ptr browser; + std::unique_ptr mappingPane; + std::unique_ptr partSidebar; struct ZoneTraits { - using OutPaneTraits = multi::OutPaneZoneTraits; - using ModPaneTraits = multi::ModPaneZoneTraits; + using OutPaneTraits = OutPaneZoneTraits; + using ModPaneTraits = ModPaneZoneTraits; static constexpr bool forZone{true}; }; struct GroupTraits { - using OutPaneTraits = multi::OutPaneGroupTraits; - using ModPaneTraits = multi::ModPaneGroupTraits; + using OutPaneTraits = OutPaneGroupTraits; + using ModPaneTraits = ModPaneGroupTraits; static constexpr bool forZone{false}; }; @@ -90,15 +88,15 @@ struct MultiScreen : juce::Component, HasEditor { static constexpr bool forZone{ZGTrait::forZone}; static constexpr bool forGroup{!ZGTrait::forZone}; - ZoneOrGroupElements(MultiScreen *parent); + ZoneOrGroupElements(EditScreen *parent); ~ZoneOrGroupElements(); - std::unique_ptr> outPane; - std::unique_ptr lfo; - std::array, 2> eg; + std::unique_ptr> outPane; + std::unique_ptr lfo; + std::array, 2> eg; - std::unique_ptr> modPane; + std::unique_ptr> modPane; - std::unique_ptr processors[numProcessorDisplays]; + std::unique_ptr processors[numProcessorDisplays]; void setVisible(bool b); void layoutInto(const juce::Rectangle &mainRect); @@ -115,8 +113,8 @@ struct MultiScreen : juce::Component, HasEditor return groupElements; } - MultiScreen(SCXTEditor *e); - ~MultiScreen(); + EditScreen(SCXTEditor *e); + ~EditScreen(); void resized() override { layout(); } void layout(); @@ -136,7 +134,8 @@ struct MultiScreen : juce::Component, HasEditor // part differentiated selection std::string tabKey(const std::string &s) { return s; } - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MultiScreen); + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(EditScreen); }; -} // namespace scxt::ui +} // namespace edit_screen +} // namespace scxt::ui::app #endif // SHORTCIRCUIT_MULTISCREEN_H diff --git a/src-ui/components/multi/AdsrPane.cpp b/src-ui/app/edit-screen/components/AdsrPane.cpp similarity index 97% rename from src-ui/components/multi/AdsrPane.cpp rename to src-ui/app/edit-screen/components/AdsrPane.cpp index ed6924ba..daf331b9 100644 --- a/src-ui/components/multi/AdsrPane.cpp +++ b/src-ui/app/edit-screen/components/AdsrPane.cpp @@ -26,10 +26,10 @@ */ #include "AdsrPane.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "sst/jucegui/components/Label.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { namespace cmsg = scxt::messaging::client; namespace comp = sst::jucegui::components; @@ -144,4 +144,4 @@ void AdsrPane::showHamburgerMenu() p.showMenuAsync(editor->defaultPopupMenuOptions()); } -} // namespace scxt::ui::multi \ No newline at end of file +} // namespace scxt::ui::app::edit_screen \ No newline at end of file diff --git a/src-ui/components/multi/AdsrPane.h b/src-ui/app/edit-screen/components/AdsrPane.h similarity index 95% rename from src-ui/components/multi/AdsrPane.h rename to src-ui/app/edit-screen/components/AdsrPane.h index 1b4cc2cb..f8efaace 100644 --- a/src-ui/components/multi/AdsrPane.h +++ b/src-ui/app/edit-screen/components/AdsrPane.h @@ -35,12 +35,12 @@ #include "sst/jucegui/components/Label.h" #include "sst/jucegui/components/Knob.h" #include "sst/jucegui/data/Continuous.h" -#include "components/HasEditor.h" +#include "app/HasEditor.h" #include "connectors/PayloadDataAttachment.h" #include "messaging/messaging.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { struct AdsrPane : sst::jucegui::components::NamedPanel, HasEditor { @@ -70,6 +70,6 @@ struct AdsrPane : sst::jucegui::components::NamedPanel, HasEditor void showHamburgerMenu(); }; -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen #endif // SHORTCIRCUIT_ADSRPANE_H diff --git a/src-ui/components/multi/detail/GroupZoneTreeControl.h b/src-ui/app/edit-screen/components/GroupZoneTreeControl.h similarity index 99% rename from src-ui/components/multi/detail/GroupZoneTreeControl.h rename to src-ui/app/edit-screen/components/GroupZoneTreeControl.h index 178bd00f..2e80b8c0 100644 --- a/src-ui/components/multi/detail/GroupZoneTreeControl.h +++ b/src-ui/app/edit-screen/components/GroupZoneTreeControl.h @@ -34,7 +34,7 @@ #include "sst/jucegui/components/GlyphButton.h" #include "sst/jucegui/components/Label.h" -namespace scxt::ui::multi::detail +namespace scxt::ui::app::edit_screen { namespace jcmp = sst::jucegui::components; @@ -418,6 +418,6 @@ template struct GroupZoneListBoxModel : juce:: } }; -} // namespace scxt::ui::multi::detail +} // namespace scxt::ui::app::edit_screen #endif // SHORTCIRCUITXT_PARTGROUPTREE_H diff --git a/src-ui/components/multi/LFOPane.cpp b/src-ui/app/edit-screen/components/LFOPane.cpp similarity index 99% rename from src-ui/components/multi/LFOPane.cpp rename to src-ui/app/edit-screen/components/LFOPane.cpp index 7a01853d..0cd27d2b 100644 --- a/src-ui/components/multi/LFOPane.cpp +++ b/src-ui/app/edit-screen/components/LFOPane.cpp @@ -32,7 +32,7 @@ #include "datamodel/metadata.h" #include "juce_gui_basics/juce_gui_basics.h" #include "messaging/messaging.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "sst/jucegui/components/GlyphButton.h" #include "sst/jucegui/components/GlyphPainter.h" #include "sst/jucegui/components/NamedPanel.h" @@ -40,9 +40,9 @@ // Included so we can have UI-thread exceution for curve rendering #include "modulation/modulators/steplfo.h" -#include "components/MultiScreen.h" +#include "app/edit-screen/EditScreen.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { namespace jcmp = sst::jucegui::components; @@ -60,7 +60,7 @@ template void LfoPane::setAttachmentAsTemposync(T &t) const int MG = 5; const int BUTTON_H = 18; -struct StepLFOPane : juce::Component, HasEditor +struct StepLFOPane : juce::Component, app::HasEditor { struct StepRender : juce::Component { @@ -719,7 +719,7 @@ void LfoPane::tabChanged(int i) getContentAreaComponent()->removeAllChildren(); rebuildPanelComponents(); auto kn = std::string("multi") + (forZone ? ".zone.lfo" : ".group.lfo"); - editor->setTabSelection(editor->multiScreen->tabKey(kn), std::to_string(i)); + editor->setTabSelection(editor->editScreen->tabKey(kn), std::to_string(i)); } void LfoPane::setActive(int i, bool b) @@ -874,4 +874,4 @@ void LfoPane::pickPresets() m.showMenuAsync(editor->defaultPopupMenuOptions()); #endif } -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen diff --git a/src-ui/components/multi/LFOPane.h b/src-ui/app/edit-screen/components/LFOPane.h similarity index 95% rename from src-ui/components/multi/LFOPane.h rename to src-ui/app/edit-screen/components/LFOPane.h index fec2a8f6..ce55718b 100644 --- a/src-ui/components/multi/LFOPane.h +++ b/src-ui/app/edit-screen/components/LFOPane.h @@ -36,13 +36,13 @@ #include "sst/jucegui/components/Knob.h" #include "sst/jucegui/components/Label.h" -#include "components/HasEditor.h" +#include "app/HasEditor.h" #include "connectors/PayloadDataAttachment.h" #include "modulation/modulators/steplfo.h" #include "engine/zone.h" #include -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { namespace jcmp = sst::jucegui::components; @@ -52,7 +52,7 @@ struct CurveLFOPane; struct ENVLFOPane; struct MSEGLFOPane; -struct LfoPane : sst::jucegui::components::NamedPanel, HasEditor +struct LfoPane : sst::jucegui::components::NamedPanel, app::HasEditor { typedef connectors::PayloadDataAttachment attachment_t; typedef connectors::DiscretePayloadDataAttachmenteditor), display(d) {} +MappingZones::MappingZones(MappingDisplay *d) : HasEditor(d->editor), display(d) {} void MappingZones::mouseDown(const juce::MouseEvent &e) { @@ -2649,7 +2649,7 @@ struct SampleDisplay : juce::Component, HasEditor MappingPane *parentPane{nullptr}; }; -SampleWaveform::SampleWaveform(scxt::ui::multi::SampleDisplay *d) : display(d), HasEditor(d->editor) +SampleWaveform::SampleWaveform(SampleDisplay *d) : display(d), HasEditor(d->editor) { addAndMakeVisible(samplePlaybackPosition); } @@ -2987,12 +2987,13 @@ void SampleWaveform::updateSamplePlaybackPosition(int64_t samplePos) struct MacroDisplay : HasEditor, juce::Component { - std::array, scxt::macrosPerPart> macros; + std::array, scxt::macrosPerPart> macros; MacroDisplay(SCXTEditor *e) : HasEditor(e) { for (int i = 0; i < scxt::macrosPerPart; ++i) { - macros[i] = std::make_unique(editor, editor->selectedPart, i, false); + macros[i] = + std::make_unique(editor, editor->selectedPart, i, false); addAndMakeVisible(*macros[i]); // grab whatever data we have macroDataChanged(editor->selectedPart, i); @@ -3067,7 +3068,7 @@ void MappingPane::setSelectedTab(int i) macroDisplay->setVisible(i == 0); repaint(); - editor->setTabSelection(editor->multiScreen->tabKey("multi.mapping"), std::to_string(i)); + editor->setTabSelection(editor->editScreen->tabKey("multi.mapping"), std::to_string(i)); } void MappingPane::resized() @@ -3132,4 +3133,4 @@ void MappingPane::macroDataChanged(int part, int index) assert(part == editor->selectedPart); macroDisplay->macroDataChanged(part, index); } -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen diff --git a/src-ui/components/multi/MappingPane.h b/src-ui/app/edit-screen/components/MappingPane.h similarity index 95% rename from src-ui/components/multi/MappingPane.h rename to src-ui/app/edit-screen/components/MappingPane.h index 65014632..5a0f219d 100644 --- a/src-ui/components/multi/MappingPane.h +++ b/src-ui/app/edit-screen/components/MappingPane.h @@ -29,12 +29,12 @@ #define SCXT_SRC_UI_COMPONENTS_MULTI_MAPPINGPANE_H #include "sst/jucegui/components/NamedPanel.h" -#include "components/HasEditor.h" +#include "app/HasEditor.h" #include "engine/zone.h" #include "engine/part.h" #include "selection/selection_manager.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { // Each of these are in the cpp file struct MappingDisplay; @@ -69,5 +69,5 @@ struct MappingPane : sst::jucegui::components::NamedPanel, HasEditor void invertScroll(bool invert); bool invertScroll() const; }; -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen #endif // SHORTCIRCUIT_MAPPINGPANE_H diff --git a/src-ui/components/multi/ModPane.cpp b/src-ui/app/edit-screen/components/ModPane.cpp similarity index 99% rename from src-ui/components/multi/ModPane.cpp rename to src-ui/app/edit-screen/components/ModPane.cpp index 0bdadf4f..c0bac0c9 100644 --- a/src-ui/components/multi/ModPane.cpp +++ b/src-ui/app/edit-screen/components/ModPane.cpp @@ -26,7 +26,7 @@ */ #include "ModPane.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "connectors/PayloadDataAttachment.h" #include "sst/jucegui/components/GlyphPainter.h" #include "sst/jucegui/components/HSliderFilled.h" @@ -36,7 +36,7 @@ #include "sst/jucegui/components/Viewport.h" #include "messaging/client/client_serial.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { namespace cmsg = scxt::messaging::client; namespace jcmp = sst::jucegui::components; @@ -744,4 +744,4 @@ template void ModPane::refreshMatrix() template struct ModPane; template struct ModPane; -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen diff --git a/src-ui/components/multi/ModPane.h b/src-ui/app/edit-screen/components/ModPane.h similarity index 96% rename from src-ui/components/multi/ModPane.h rename to src-ui/app/edit-screen/components/ModPane.h index 8bb78ddf..aab87b05 100644 --- a/src-ui/components/multi/ModPane.h +++ b/src-ui/app/edit-screen/components/ModPane.h @@ -29,11 +29,11 @@ #define SCXT_SRC_UI_COMPONENTS_MULTI_MODPANE_H #include "sst/jucegui/components/NamedPanel.h" -#include "components/HasEditor.h" +#include "app/HasEditor.h" #include "modulation/voice_matrix.h" #include "modulation/group_matrix.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { struct ModPaneZoneTraits @@ -92,5 +92,5 @@ template struct ModPane : sst::jucegui::components::NamedPane std::unique_ptr viewPort; std::unique_ptr viewPortComponents; }; -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen #endif // SHORTCIRCUIT_MAPPINGPANE_H diff --git a/src-ui/components/multi/OutputPane.cpp b/src-ui/app/edit-screen/components/OutputPane.cpp similarity index 99% rename from src-ui/components/multi/OutputPane.cpp rename to src-ui/app/edit-screen/components/OutputPane.cpp index 5321dc39..92562653 100644 --- a/src-ui/components/multi/OutputPane.cpp +++ b/src-ui/app/edit-screen/components/OutputPane.cpp @@ -27,7 +27,7 @@ #include "OutputPane.h" #include "ProcessorPane.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "sst/jucegui/components/Label.h" #include "sst/jucegui/components/Knob.h" #include "sst/jucegui/components/HSliderFilled.h" @@ -37,7 +37,7 @@ #include "datamodel/metadata.h" #include "theme/Layout.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { namespace jcmp = sst::jucegui::components; @@ -344,4 +344,4 @@ template void OutputPane::updateFromProcessorPanes template struct OutputPane; template struct OutputPane; -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen diff --git a/src-ui/components/multi/OutputPane.h b/src-ui/app/edit-screen/components/OutputPane.h similarity index 96% rename from src-ui/components/multi/OutputPane.h rename to src-ui/app/edit-screen/components/OutputPane.h index 0eafa9e7..ac3e8397 100644 --- a/src-ui/components/multi/OutputPane.h +++ b/src-ui/app/edit-screen/components/OutputPane.h @@ -29,12 +29,12 @@ #define SCXT_SRC_UI_COMPONENTS_MULTI_OUTPUTPANE_H #include "sst/jucegui/components/NamedPanel.h" -#include "components/HasEditor.h" +#include "app/HasEditor.h" #include "engine/zone.h" #include "engine/group.h" #include "messaging/messaging.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { struct ProcessorPane; @@ -88,5 +88,5 @@ template struct OutputPane : sst::jucegui::components::Named std::array, scxt::processorsPerZoneAndGroup> procWeakRefs; }; -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen #endif // SHORTCIRCUIT_MAPPINGPANE_H diff --git a/src-ui/components/multi/PartGroupSidebar.cpp b/src-ui/app/edit-screen/components/PartGroupSidebar.cpp similarity index 92% rename from src-ui/components/multi/PartGroupSidebar.cpp rename to src-ui/app/edit-screen/components/PartGroupSidebar.cpp index ecdc37c2..51256558 100644 --- a/src-ui/components/multi/PartGroupSidebar.cpp +++ b/src-ui/app/edit-screen/components/PartGroupSidebar.cpp @@ -26,18 +26,18 @@ */ #include "PartGroupSidebar.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "selection/selection_manager.h" #include "sst/jucegui/components/GlyphButton.h" #include "sst/jucegui/components/Label.h" #include "sst/jucegui/components/Viewport.h" #include "messaging/messaging.h" -#include "components/MultiScreen.h" +#include "app/edit-screen/EditScreen.h" #include "connectors/PayloadDataAttachment.h" -#include "detail/GroupZoneTreeControl.h" -#include "PartSidebarCard.h" +#include "GroupZoneTreeControl.h" +#include "app/shared/PartSidebarCard.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { namespace jcmp = sst::jucegui::components; namespace cmsg = scxt::messaging::client; @@ -47,7 +47,7 @@ struct PartSidebar : juce::Component, HasEditor PartGroupSidebar *partGroupSidebar{nullptr}; std::unique_ptr viewport; std::unique_ptr viewportContents; - std::array, scxt::numParts> parts; + std::array, scxt::numParts> parts; PartSidebar(PartGroupSidebar *p) : partGroupSidebar(p), HasEditor(p->editor) { @@ -55,7 +55,7 @@ struct PartSidebar : juce::Component, HasEditor viewportContents = std::make_unique(); for (int i = 0; i < scxt::numParts; ++i) { - parts[i] = std::make_unique(i, editor); + parts[i] = std::make_unique(i, editor); viewportContents->addAndMakeVisible(*parts[i]); } viewport->setViewedComponent(viewportContents.get(), false); @@ -63,14 +63,14 @@ struct PartSidebar : juce::Component, HasEditor } void resized() override { - auto w = PartSidebarCard::width + viewport->getScrollBarThickness() + 2; + auto w = shared::PartSidebarCard::width + viewport->getScrollBarThickness() + 2; viewport->setBounds(getLocalBounds().withWidth(w).translated(3, 0)); - viewportContents->setBounds(0, 0, PartSidebarCard::width, - PartSidebarCard::height * scxt::numParts); + viewportContents->setBounds(0, 0, shared::PartSidebarCard::width, + shared::PartSidebarCard::height * scxt::numParts); for (int i = 0; i < scxt::numParts; ++i) { - parts[i]->setBounds(0, i * PartSidebarCard::height, PartSidebarCard::width, - PartSidebarCard::height); + parts[i]->setBounds(0, i * shared::PartSidebarCard::height, + shared::PartSidebarCard::width, shared::PartSidebarCard::height); } } }; @@ -80,7 +80,7 @@ struct GroupZoneSidebarBase : juce::Component, HasEditor, juce::DragAndDropConta { PartGroupSidebar *partGroupSidebar{nullptr}; std::unique_ptr listBox; - std::unique_ptr> listBoxModel; + std::unique_ptr> listBoxModel; std::unique_ptr partSelector; T *asT() { return static_cast(this); } @@ -95,7 +95,7 @@ struct GroupZoneSidebarBase : juce::Component, HasEditor, juce::DragAndDropConta void postInit() { - listBoxModel = std::make_unique>(asT()); + listBoxModel = std::make_unique>(asT()); listBoxModel->rebuild(); listBox = std::make_unique(); listBox->setModel(listBoxModel.get()); @@ -455,15 +455,15 @@ void PartGroupSidebar::setSelectedTab(int t) groupSidebar->setVisible(g); zoneSidebar->setVisible(z); - editor->multiScreen->setSelectionMode(g ? MultiScreen::SelectionMode::GROUP - : MultiScreen::SelectionMode::ZONE); + editor->editScreen->setSelectionMode(g ? EditScreen::SelectionMode::GROUP + : EditScreen::SelectionMode::ZONE); if (g) editor->themeApplier.applyGroupMultiScreenTheme(this); else editor->themeApplier.applyZoneMultiScreenTheme(this); - editor->setTabSelection(editor->multiScreen->tabKey("multi.pgz"), + editor->setTabSelection(editor->editScreen->tabKey("multi.pgz"), (t == 0 ? "part" : (t == 1 ? "group" : "zone"))); repaint(); } @@ -472,4 +472,4 @@ void PartGroupSidebar::partConfigurationChanged(int i) { partSidebar->parts[i]->resetFromEditorCache(); } -} // namespace scxt::ui::multi \ No newline at end of file +} // namespace scxt::ui::app::edit_screen \ No newline at end of file diff --git a/src-ui/components/multi/PartGroupSidebar.h b/src-ui/app/edit-screen/components/PartGroupSidebar.h similarity index 95% rename from src-ui/components/multi/PartGroupSidebar.h rename to src-ui/app/edit-screen/components/PartGroupSidebar.h index ccfcb068..10cb6d54 100644 --- a/src-ui/components/multi/PartGroupSidebar.h +++ b/src-ui/app/edit-screen/components/PartGroupSidebar.h @@ -30,10 +30,10 @@ #include #include "sst/jucegui/components/NamedPanel.h" -#include "components/HasEditor.h" +#include "app/HasEditor.h" #include "engine/engine.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { struct GroupSidebar; struct PartSidebar; @@ -62,6 +62,6 @@ struct PartGroupSidebar : sst::jucegui::components::NamedPanel, HasEditor void resized() override; }; -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen #endif // SHORTCIRCUIT_PARTGROUPSIDEBAR_H diff --git a/src-ui/components/multi/ProcessorPane.cpp b/src-ui/app/edit-screen/components/ProcessorPane.cpp similarity index 99% rename from src-ui/components/multi/ProcessorPane.cpp rename to src-ui/app/edit-screen/components/ProcessorPane.cpp index 21301855..35bdc1a3 100644 --- a/src-ui/components/multi/ProcessorPane.cpp +++ b/src-ui/app/edit-screen/components/ProcessorPane.cpp @@ -26,7 +26,7 @@ */ #include "ProcessorPane.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "connectors/JSONAssetSupport.h" @@ -42,7 +42,7 @@ #include "theme/Layout.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { namespace cmsg = scxt::messaging::client; namespace jcmp = sst::jucegui::components; @@ -1144,4 +1144,4 @@ void ProcessorPane::setAsMultiZone(int32_t primaryType, const std::string &nm, repaint(); } -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen diff --git a/src-ui/components/multi/ProcessorPane.h b/src-ui/app/edit-screen/components/ProcessorPane.h similarity index 98% rename from src-ui/components/multi/ProcessorPane.h rename to src-ui/app/edit-screen/components/ProcessorPane.h index b5e861bb..a7b62dcf 100644 --- a/src-ui/components/multi/ProcessorPane.h +++ b/src-ui/app/edit-screen/components/ProcessorPane.h @@ -42,11 +42,11 @@ #include "sst/jucegui/layouts/ExplicitLayout.h" #include "sst/jucegui/data/Continuous.h" #include "dsp/processor/processor.h" -#include "components/HasEditor.h" +#include "app/HasEditor.h" #include "connectors/PayloadDataAttachment.h" #include "engine/zone.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { struct ProcessorPane : sst::jucegui::components::NamedPanel, HasEditor, juce::DragAndDropTarget { @@ -261,6 +261,6 @@ struct ProcessorPane : sst::jucegui::components::NamedPanel, HasEditor, juce::Dr return res; } }; -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen #endif // SHORTCIRCUIT_ADSRPANE_H diff --git a/src-ui/components/multi/ProcessorPaneEQsFilters.cpp b/src-ui/app/edit-screen/components/ProcessorPaneEQsFilters.cpp similarity index 99% rename from src-ui/components/multi/ProcessorPaneEQsFilters.cpp rename to src-ui/app/edit-screen/components/ProcessorPaneEQsFilters.cpp index aef42492..dba55ecd 100644 --- a/src-ui/components/multi/ProcessorPaneEQsFilters.cpp +++ b/src-ui/app/edit-screen/components/ProcessorPaneEQsFilters.cpp @@ -26,7 +26,7 @@ */ #include "ProcessorPane.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "sst/jucegui/components/VSlider.h" #include "sst/jucegui/components/JogUpDownButton.h" #include "theme/Layout.h" @@ -45,7 +45,7 @@ #include "theme/Layout.h" -namespace scxt::ui::multi +namespace scxt::ui::app::edit_screen { namespace jcmp = sst::jucegui::components; @@ -457,4 +457,4 @@ void ProcessorPane::layoutControlsEQGraphic() otherEditors.push_back(std::move(eqdisp)); } -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::edit_screen diff --git a/src-ui/components/HasEditor.cpp b/src-ui/app/editor-impl/HasEditor.cpp similarity index 91% rename from src-ui/components/HasEditor.cpp rename to src-ui/app/editor-impl/HasEditor.cpp index 0490b532..86553901 100644 --- a/src-ui/components/HasEditor.cpp +++ b/src-ui/app/editor-impl/HasEditor.cpp @@ -25,10 +25,10 @@ * https://github.com/surge-synthesizer/shortcircuit-xt */ -#include "HasEditor.h" -#include "SCXTEditor.h" +#include "app/HasEditor.h" +#include "app/SCXTEditor.h" -namespace scxt::ui +namespace scxt::ui::app { HasEditor::HasEditor(SCXTEditor *e) : editor(e) {} -} // namespace scxt::ui \ No newline at end of file +} // namespace scxt::ui::app \ No newline at end of file diff --git a/src-ui/components/SCXTEditor.cpp b/src-ui/app/editor-impl/SCXTEditor.cpp similarity index 90% rename from src-ui/components/SCXTEditor.cpp rename to src-ui/app/editor-impl/SCXTEditor.cpp index 5c758c4a..60af1f54 100644 --- a/src-ui/components/SCXTEditor.cpp +++ b/src-ui/app/editor-impl/SCXTEditor.cpp @@ -26,19 +26,19 @@ */ #include "melatonin_inspector/melatonin_inspector.h" -#include "SCXTEditor.h" +#include "app/SCXTEditor.h" -#include "PlayScreen.h" +#include "app/play-screen/PlayScreen.h" #include "sst/jucegui/style/StyleSheet.h" #include "infrastructure/user_defaults.h" -#include "HeaderRegion.h" -#include "MultiScreen.h" -#include "MixerScreen.h" -#include "AboutScreen.h" -#include "LogScreen.h" -#include "WelcomeScreen.h" +#include "app/shared/HeaderRegion.h" +#include "app/edit-screen/EditScreen.h" +#include "app/mixer-screen/MixerScreen.h" +#include "app/other-screens/AboutScreen.h" +#include "app/other-screens/LogScreen.h" +#include "app/other-screens/WelcomeScreen.h" #include "SCXTJuceLookAndFeel.h" #include "sst/jucegui/components/ToolTip.h" #include @@ -47,7 +47,7 @@ #include #endif -namespace scxt::ui +namespace scxt::ui::app { SCXTEditor::SCXTEditor(messaging::MessageController &e, infrastructure::DefaultsProvider &d, @@ -85,25 +85,25 @@ SCXTEditor::SCXTEditor(messaging::MessageController &e, infrastructure::Defaults juce::MessageManager::callAsync([this]() { drainCallbackQueue(); }); }); - headerRegion = std::make_unique(this); + headerRegion = std::make_unique(this); addAndMakeVisible(*headerRegion); - multiScreen = std::make_unique(this); - addAndMakeVisible(*multiScreen); + editScreen = std::make_unique(this); + addAndMakeVisible(*editScreen); - mixerScreen = std::make_unique(this); + mixerScreen = std::make_unique(this); addChildComponent(*mixerScreen); - playScreen = std::make_unique(this); + playScreen = std::make_unique(this); addChildComponent(*playScreen); - aboutScreen = std::make_unique(this); + aboutScreen = std::make_unique(this); addChildComponent(*aboutScreen); - welcomeScreen = std::make_unique(this); + welcomeScreen = std::make_unique(this); addChildComponent(*welcomeScreen); - logScreen = std::make_unique(this); + logScreen = std::make_unique(this); addChildComponent(*logScreen); setStyle(style()); @@ -133,7 +133,7 @@ void SCXTEditor::setActiveScreen(ActiveScreen s) switch (s) { case MULTI: - multiScreen->setVisible(true); + editScreen->setVisible(true); mixerScreen->setVisible(false); playScreen->setVisible(false); val = "multi"; @@ -141,7 +141,7 @@ void SCXTEditor::setActiveScreen(ActiveScreen s) break; case MIXER: - multiScreen->setVisible(false); + editScreen->setVisible(false); mixerScreen->setVisible(true); playScreen->setVisible(false); val = "mixer"; @@ -149,7 +149,7 @@ void SCXTEditor::setActiveScreen(ActiveScreen s) break; case PLAY: - multiScreen->setVisible(false); + editScreen->setVisible(false); mixerScreen->setVisible(false); playScreen->setVisible(true); val = "play"; @@ -193,8 +193,8 @@ void SCXTEditor::resized() static constexpr int32_t headerHeight{40}; headerRegion->setBounds(0, 0, getWidth(), headerHeight); - if (multiScreen->isVisible()) - multiScreen->setBounds(0, headerHeight, getWidth(), getHeight() - headerHeight); + if (editScreen->isVisible()) + editScreen->setBounds(0, headerHeight, getWidth(), getHeight() - headerHeight); if (mixerScreen->isVisible()) mixerScreen->setBounds(0, headerHeight, getWidth(), getHeight() - headerHeight); if (playScreen->isVisible()) @@ -221,14 +221,14 @@ void SCXTEditor::idle() { headerRegion->setVoiceCount(sharedUiMemoryState.voiceCount); - if (multiScreen->isVisible()) + if (editScreen->isVisible()) { - multiScreen->onVoiceInfoChanged(); + editScreen->onVoiceInfoChanged(); } } } - if (multiScreen->isVisible()) + if (editScreen->isVisible()) { if (currentLeadZoneSelection.has_value()) { @@ -239,7 +239,7 @@ void SCXTEditor::idle() v.part == currentLeadZoneSelection->part && v.zone == currentLeadZoneSelection->zone) { - multiScreen->updateSamplePlaybackPosition(v.sample, v.samplePos); + editScreen->updateSamplePlaybackPosition(v.sample, v.samplePos); } } } @@ -259,7 +259,7 @@ void SCXTEditor::idle() if (checkWelcomeCountdown == 0) { auto sc = defaultsProvider.getUserDefaultValue(scxt::infrastructure::welcomeScreenSeen, -1); - if (sc != WelcomeScreen::welcomeVersion) + if (sc != other_screens::WelcomeScreen::welcomeVersion) { showWelcomeOverlay(); } @@ -442,4 +442,4 @@ std::function SCXTEditor::makeComingSoon(const std::string &feature) con f + " is not yet implemented", "OK"); }; } -} // namespace scxt::ui +} // namespace scxt::ui::app diff --git a/src-ui/components/SCXTEditorMenus.cpp b/src-ui/app/editor-impl/SCXTEditorMenus.cpp similarity index 95% rename from src-ui/components/SCXTEditorMenus.cpp rename to src-ui/app/editor-impl/SCXTEditorMenus.cpp index 4d2c4337..8ae99aa3 100644 --- a/src-ui/components/SCXTEditorMenus.cpp +++ b/src-ui/app/editor-impl/SCXTEditorMenus.cpp @@ -27,21 +27,21 @@ #include "melatonin_inspector/melatonin_inspector.h" -#include "SCXTEditor.h" -#include "MultiScreen.h" -#include "multi/AdsrPane.h" -#include "multi/LFOPane.h" -#include "multi/ModPane.h" -#include "multi/ProcessorPane.h" -#include "multi/PartGroupSidebar.h" -#include "HeaderRegion.h" -#include "components/multi/MappingPane.h" -#include "components/AboutScreen.h" #include "infrastructure/user_defaults.h" +#include "app/SCXTEditor.h" +#include "app/edit-screen/EditScreen.h" +#include "app/edit-screen/components/AdsrPane.h" +#include "app/edit-screen/components/LFOPane.h" +#include "app/edit-screen/components/ModPane.h" +#include "app/edit-screen/components/ProcessorPane.h" +#include "app/edit-screen/components/PartGroupSidebar.h" +#include "app/shared/HeaderRegion.h" +#include "app/edit-screen/components/MappingPane.h" +#include "app/other-screens/AboutScreen.h" #include -namespace scxt::ui +namespace scxt::ui::app { namespace cmsg = scxt::messaging::client; @@ -210,7 +210,7 @@ void SCXTEditor::addZoomMenu(juce::PopupMenu &p, bool addTitle) w->defaultsProvider.updateUserDefaultValue( infrastructure::DefaultKeys::invertScroll, newScrollBehavior ? 1 : 0); - w->multiScreen->sample->invertScroll(newScrollBehavior); + w->editScreen->mappingPane->invertScroll(newScrollBehavior); } }); @@ -323,4 +323,4 @@ void SCXTEditor::addUIThemesMenu(juce::PopupMenu &p, bool addTitle) } } -} // namespace scxt::ui +} // namespace scxt::ui::app diff --git a/src-ui/components/SCXTEditorResponseHandlers.cpp b/src-ui/app/editor-impl/SCXTEditorResponseHandlers.cpp similarity index 65% rename from src-ui/components/SCXTEditorResponseHandlers.cpp rename to src-ui/app/editor-impl/SCXTEditorResponseHandlers.cpp index 9e25f2d2..3940a0fa 100644 --- a/src-ui/components/SCXTEditorResponseHandlers.cpp +++ b/src-ui/app/editor-impl/SCXTEditorResponseHandlers.cpp @@ -25,22 +25,22 @@ * https://github.com/surge-synthesizer/shortcircuit-xt */ -#include "SCXTEditor.h" -#include "MultiScreen.h" -#include "multi/AdsrPane.h" -#include "multi/LFOPane.h" -#include "multi/ModPane.h" -#include "multi/ProcessorPane.h" -#include "multi/PartGroupSidebar.h" -#include "multi/OutputPane.h" -#include "MixerScreen.h" -#include "HeaderRegion.h" -#include "multi/MappingPane.h" -#include "AboutScreen.h" -#include "browser/BrowserPane.h" -#include "PlayScreen.h" - -namespace scxt::ui +#include "app/SCXTEditor.h" +#include "app/edit-screen/EditScreen.h" +#include "app/edit-screen/components/AdsrPane.h" +#include "app/edit-screen/components/LFOPane.h" +#include "app/edit-screen/components/ModPane.h" +#include "app/edit-screen/components/ProcessorPane.h" +#include "app/edit-screen/components/PartGroupSidebar.h" +#include "app/edit-screen/components/OutputPane.h" +#include "app/mixer-screen/MixerScreen.h" +#include "app/shared/HeaderRegion.h" +#include "app/edit-screen/components/MappingPane.h" +#include "app/other-screens/AboutScreen.h" +#include "app/browser-ui/BrowserPane.h" +#include "app/play-screen/PlayScreen.h" + +namespace scxt::ui::app { void SCXTEditor::onGroupOrZoneEnvelopeUpdated( const scxt::messaging::client::adsrViewResponsePayload_t &payload) @@ -51,11 +51,11 @@ void SCXTEditor::onGroupOrZoneEnvelopeUpdated( if (active) { // TODO - do I want a multiScreen->onEnvelopeUpdated or just - multiScreen->getZoneElements()->eg[which]->adsrChangedFromModel(env); + editScreen->getZoneElements()->eg[which]->adsrChangedFromModel(env); } else { - multiScreen->getZoneElements()->eg[which]->adsrDeactivated(); + editScreen->getZoneElements()->eg[which]->adsrDeactivated(); } } else @@ -63,11 +63,11 @@ void SCXTEditor::onGroupOrZoneEnvelopeUpdated( if (active) { // TODO - do I want a multiScreen->onEnvelopeUpdated or just - multiScreen->getGroupElements()->eg[which]->adsrChangedFromModel(env); + editScreen->getGroupElements()->eg[which]->adsrChangedFromModel(env); } else { - multiScreen->getGroupElements()->eg[which]->adsrDeactivated(); + editScreen->getGroupElements()->eg[which]->adsrDeactivated(); } } } @@ -78,13 +78,13 @@ void SCXTEditor::onMappingUpdated( const auto &[active, m] = payload; if (active) { - multiScreen->sample->setActive(true); - multiScreen->sample->setMappingData(m); + editScreen->mappingPane->setActive(true); + editScreen->mappingPane->setMappingData(m); } else { // TODO - multiScreen->sample->setActive(false); + editScreen->mappingPane->setActive(false); } } @@ -94,19 +94,19 @@ void SCXTEditor::onSamplesUpdated( const auto &[active, s] = payload; if (active) { - multiScreen->sample->setActive(true); - multiScreen->sample->setSampleData(s); + editScreen->mappingPane->setActive(true); + editScreen->mappingPane->setSampleData(s); } else { - multiScreen->sample->setActive(false); + editScreen->mappingPane->setActive(false); } } void SCXTEditor::onStructureUpdated(const engine::Engine::pgzStructure_t &s) { - if (multiScreen && multiScreen->parts) - multiScreen->parts->setPartGroupZoneStructure(s); + if (editScreen && editScreen->partSidebar) + editScreen->partSidebar->setPartGroupZoneStructure(s); } void SCXTEditor::onGroupOrZoneProcessorDataAndMetadata( @@ -114,21 +114,20 @@ void SCXTEditor::onGroupOrZoneProcessorDataAndMetadata( { const auto &[forZone, which, enabled, control, storage] = d; - assert(which >= 0 && which < MultiScreen::numProcessorDisplays); + assert(which >= 0 && which < edit_screen::EditScreen::numProcessorDisplays); if (forZone) { - multiScreen->getZoneElements()->processors[which]->setEnabled(enabled); - multiScreen->getZoneElements()->processors[which]->setProcessorControlDescriptionAndStorage( + editScreen->getZoneElements()->processors[which]->setEnabled(enabled); + editScreen->getZoneElements()->processors[which]->setProcessorControlDescriptionAndStorage( control, storage); - multiScreen->getZoneElements()->outPane->updateFromProcessorPanes(); + editScreen->getZoneElements()->outPane->updateFromProcessorPanes(); } else { - multiScreen->getGroupElements()->processors[which]->setEnabled(enabled); - multiScreen->getGroupElements() - ->processors[which] - ->setProcessorControlDescriptionAndStorage(control, storage); - multiScreen->getZoneElements()->outPane->updateFromProcessorPanes(); + editScreen->getGroupElements()->processors[which]->setEnabled(enabled); + editScreen->getGroupElements()->processors[which]->setProcessorControlDescriptionAndStorage( + control, storage); + editScreen->getZoneElements()->outPane->updateFromProcessorPanes(); } } @@ -136,47 +135,47 @@ void SCXTEditor::onZoneProcessorDataMismatch( const scxt::messaging::client::processorMismatchPayload_t &pl) { const auto &[idx, leadType, leadName, otherTypes] = pl; - multiScreen->getZoneElements()->processors[idx]->setAsMultiZone(leadType, leadName, otherTypes); + editScreen->getZoneElements()->processors[idx]->setAsMultiZone(leadType, leadName, otherTypes); } void SCXTEditor::onZoneVoiceMatrixMetadata(const scxt::voice::modulation::voiceMatrixMetadata_t &d) { const auto &[active, sinf, tinf, cinf] = d; - multiScreen->getZoneElements()->modPane->setActive(active); + editScreen->getZoneElements()->modPane->setActive(active); if (active) { - multiScreen->getZoneElements()->modPane->matrixMetadata = d; - multiScreen->getZoneElements()->modPane->rebuildMatrix(); + editScreen->getZoneElements()->modPane->matrixMetadata = d; + editScreen->getZoneElements()->modPane->rebuildMatrix(); } } void SCXTEditor::onZoneVoiceMatrix(const scxt::voice::modulation::Matrix::RoutingTable &rt) { - assert(multiScreen->getZoneElements()); - assert(multiScreen->getZoneElements()->modPane); - assert(multiScreen->getZoneElements()->modPane->isEnabled()); - multiScreen->getZoneElements()->modPane->routingTable = rt; - multiScreen->getZoneElements()->modPane->refreshMatrix(); + assert(editScreen->getZoneElements()); + assert(editScreen->getZoneElements()->modPane); + assert(editScreen->getZoneElements()->modPane->isEnabled()); + editScreen->getZoneElements()->modPane->routingTable = rt; + editScreen->getZoneElements()->modPane->refreshMatrix(); } void SCXTEditor::onGroupMatrixMetadata(const scxt::modulation::groupMatrixMetadata_t &d) { const auto &[active, sinf, dinf, cinf] = d; - multiScreen->getGroupElements()->modPane->setActive(active); + editScreen->getGroupElements()->modPane->setActive(active); if (active) { - multiScreen->getGroupElements()->modPane->matrixMetadata = d; - multiScreen->getGroupElements()->modPane->rebuildMatrix(); + editScreen->getGroupElements()->modPane->matrixMetadata = d; + editScreen->getGroupElements()->modPane->rebuildMatrix(); } } void SCXTEditor::onGroupMatrix(const scxt::modulation::GroupMatrix::RoutingTable &t) { - assert(multiScreen->getGroupElements() + assert(editScreen->getGroupElements() ->modPane->isEnabled()); // we shouldn't send a matrix to a non-enabled pane - multiScreen->getGroupElements()->modPane->routingTable = t; - multiScreen->getGroupElements()->modPane->refreshMatrix(); + editScreen->getGroupElements()->modPane->routingTable = t; + editScreen->getGroupElements()->modPane->refreshMatrix(); } void SCXTEditor::onGroupOrZoneModulatorStorageUpdated( @@ -185,39 +184,39 @@ void SCXTEditor::onGroupOrZoneModulatorStorageUpdated( const auto &[forZone, active, i, r] = payload; if (forZone) { - multiScreen->getZoneElements()->lfo->setActive(i, active); - multiScreen->getZoneElements()->lfo->setModulatorStorage(i, r); + editScreen->getZoneElements()->lfo->setActive(i, active); + editScreen->getZoneElements()->lfo->setModulatorStorage(i, r); } else { - multiScreen->getGroupElements()->lfo->setActive(i, active); - multiScreen->getGroupElements()->lfo->setModulatorStorage(i, r); + editScreen->getGroupElements()->lfo->setActive(i, active); + editScreen->getGroupElements()->lfo->setModulatorStorage(i, r); } } void SCXTEditor::onZoneOutputInfoUpdated(const scxt::messaging::client::zoneOutputInfoUpdate_t &p) { auto [active, inf] = p; - multiScreen->getZoneElements()->outPane->setActive(active); + editScreen->getZoneElements()->outPane->setActive(active); if (active) { - multiScreen->getZoneElements()->outPane->setOutputData(inf); + editScreen->getZoneElements()->outPane->setOutputData(inf); } } void SCXTEditor::onGroupOutputInfoUpdated(const scxt::messaging::client::groupOutputInfoUpdate_t &p) { auto [active, inf] = p; - multiScreen->getGroupElements()->outPane->setActive(active); + editScreen->getGroupElements()->outPane->setActive(active); if (active) { - multiScreen->getGroupElements()->outPane->setOutputData(inf); + editScreen->getGroupElements()->outPane->setOutputData(inf); } } void SCXTEditor::onGroupZoneMappingSummary(const scxt::engine::Part::zoneMappingSummary_t &d) { - multiScreen->sample->setGroupZoneMappingSummary(d); + editScreen->mappingPane->setGroupZoneMappingSummary(d); if constexpr (scxt::log::uiStructure) { @@ -258,8 +257,8 @@ void SCXTEditor::onSelectionState(const scxt::messaging::client::selectedStateMe groupsWithSelectedZones.insert(sel.group); } - multiScreen->parts->editorSelectionChanged(); - multiScreen->sample->editorSelectionChanged(); + editScreen->partSidebar->editorSelectionChanged(); + editScreen->mappingPane->editorSelectionChanged(); repaint(); @@ -284,12 +283,12 @@ void SCXTEditor::onSelectedPart(const int16_t p) SCLOG("Selected Part: " << p); } selectedPart = p; // I presume I will shortly get structure messages so don't do anything else - if (multiScreen && multiScreen->parts) - multiScreen->parts->selectedPartChanged(); - if (multiScreen && multiScreen->sample) - multiScreen->sample->selectedPartChanged(); - if (multiScreen) - multiScreen->onOtherTabSelection(); + if (editScreen && editScreen->partSidebar) + editScreen->partSidebar->selectedPartChanged(); + if (editScreen && editScreen->mappingPane) + editScreen->mappingPane->selectedPartChanged(); + if (editScreen) + editScreen->onOtherTabSelection(); repaint(); } @@ -324,8 +323,9 @@ void SCXTEditor::onMixerBusSendData(const scxt::messaging::client::busSendData_t void SCXTEditor::onBrowserRefresh(const bool) { - multiScreen->browser->resetRoots(); + editScreen->browser->resetRoots(); mixerScreen->browser->resetRoots(); + playScreen->browser->resetRoots(); } void SCXTEditor::onDebugInfoGenerated(const scxt::messaging::client::debugResponse_t &resp) @@ -341,7 +341,7 @@ void SCXTEditor::onMacroFullState(const scxt::messaging::client::macroFullState_ const auto &[part, index, macro] = s; macroCache[part][index] = macro; if (part == selectedPart) - multiScreen->sample->macroDataChanged(part, index); + editScreen->mappingPane->macroDataChanged(part, index); playScreen->macroDataChanged(part, index); } @@ -349,7 +349,7 @@ void SCXTEditor::onMacroValue(const scxt::messaging::client::macroValue_t &s) { const auto &[part, index, value] = s; macroCache[part][index].value = value; - multiScreen->sample->repaint(); + editScreen->mappingPane->repaint(); playScreen->repaint(); } @@ -384,9 +384,9 @@ void SCXTEditor::onOtherTabSelection( mixerScreen->onOtherTabSelection(); } - if (multiScreen) + if (editScreen) { - multiScreen->onOtherTabSelection(); + editScreen->onOtherTabSelection(); } } @@ -399,7 +399,7 @@ void SCXTEditor::onPartConfiguration( // When I have active show/hide i will need to rewrite this i bet if (playScreen && playScreen->partSidebars[pt]) playScreen->partSidebars[pt]->resetFromEditorCache(); - if (multiScreen && multiScreen->parts) - multiScreen->parts->partConfigurationChanged(pt); + if (editScreen && editScreen->partSidebar) + editScreen->partSidebar->partConfigurationChanged(pt); } -} // namespace scxt::ui \ No newline at end of file +} // namespace scxt::ui::app \ No newline at end of file diff --git a/src-ui/components/SCXTJuceLookAndFeel.h b/src-ui/app/editor-impl/SCXTJuceLookAndFeel.h similarity index 100% rename from src-ui/components/SCXTJuceLookAndFeel.h rename to src-ui/app/editor-impl/SCXTJuceLookAndFeel.h diff --git a/src-ui/components/MixerScreen.cpp b/src-ui/app/mixer-screen/MixerScreen.cpp similarity index 92% rename from src-ui/components/MixerScreen.cpp rename to src-ui/app/mixer-screen/MixerScreen.cpp index 469739bf..fd63489a 100644 --- a/src-ui/components/MixerScreen.cpp +++ b/src-ui/app/mixer-screen/MixerScreen.cpp @@ -25,31 +25,31 @@ * https://github.com/surge-synthesizer/shortcircuit-xt */ -#include "HasEditor.h" -#include "browser/BrowserPane.h" -#include "mixer/BusPane.h" -#include "mixer/PartEffectsPane.h" +#include "MixerScreen.h" +#include "app/HasEditor.h" +#include "app/browser-ui/BrowserPane.h" +#include "app/mixer-screen/components/BusPane.h" +#include "app/mixer-screen/components/PartEffectsPane.h" #include "messaging/messaging.h" #include "utils.h" -#include "MixerScreen.h" -#include "SCXTEditor.h" +#include "app/SCXTEditor.h" -namespace scxt::ui +namespace scxt::ui::app::mixer_screen { namespace cmsg = scxt::messaging::client; MixerScreen::MixerScreen(SCXTEditor *e) : HasEditor(e) { - browser = std::make_unique(editor); + browser = std::make_unique(editor); addAndMakeVisible(*browser); - busPane = std::make_unique(e, this); + busPane = std::make_unique(e, this); addAndMakeVisible(*busPane); for (auto i = 0; i < partPanes.size(); ++i) { - auto pp = std::make_unique(editor, this, i); + auto pp = std::make_unique(editor, this, i); pp->setBusAddress(0); addAndMakeVisible(*pp); @@ -211,4 +211,4 @@ void MixerScreen::onOtherTabSelection() } } -} // namespace scxt::ui \ No newline at end of file +} // namespace scxt::ui::app::mixer_screen \ No newline at end of file diff --git a/src-ui/components/MixerScreen.h b/src-ui/app/mixer-screen/MixerScreen.h similarity index 85% rename from src-ui/components/MixerScreen.h rename to src-ui/app/mixer-screen/MixerScreen.h index e636e414..ad89487d 100644 --- a/src-ui/components/MixerScreen.h +++ b/src-ui/app/mixer-screen/MixerScreen.h @@ -29,22 +29,22 @@ #define SCXT_SRC_UI_COMPONENTS_MIXERSCREEN_H #include "configuration.h" -#include "HasEditor.h" -#include "SCXTEditor.h" -#include "browser/BrowserPane.h" +#include "app/HasEditor.h" +#include "app/browser-ui/BrowserPane.h" #include +#include "engine/engine.h" +#include "datamodel/metadata.h" -namespace scxt::ui +namespace scxt::ui::app { -namespace browser +namespace browser_ui { struct BrowserPane; } -namespace mixer +namespace mixer_screen { struct PartEffectsPane; struct BusPane; -} // namespace mixer struct MixerScreen : juce::Component, HasEditor { static constexpr int sideWidths = 196; // copied from multi for now @@ -61,9 +61,10 @@ struct MixerScreen : juce::Component, HasEditor const std::array &, const engine::BusEffectStorage &); - std::unique_ptr browser; - std::array, engine::Bus::maxEffectsPerBus> partPanes; - std::unique_ptr busPane; + std::unique_ptr browser; + std::array, engine::Bus::maxEffectsPerBus> + partPanes; + std::unique_ptr busPane; using partFXMD_t = std::array; using partFXStorage_t = std::pair; @@ -90,5 +91,6 @@ struct MixerScreen : juce::Component, HasEditor void onOtherTabSelection(); }; -} // namespace scxt::ui +} // namespace mixer_screen +} // namespace scxt::ui::app #endif // SHORTCIRCUIT_SENDFXSCREEN_H diff --git a/src-ui/components/mixer/BusPane.cpp b/src-ui/app/mixer-screen/components/BusPane.cpp similarity index 96% rename from src-ui/components/mixer/BusPane.cpp rename to src-ui/app/mixer-screen/components/BusPane.cpp index 69564b90..32af57cc 100644 --- a/src-ui/components/mixer/BusPane.cpp +++ b/src-ui/app/mixer-screen/components/BusPane.cpp @@ -26,10 +26,10 @@ */ #include "BusPane.h" - +#include "app/SCXTEditor.h" #include "sst/jucegui/components/Viewport.h" -namespace scxt::ui::mixer +namespace scxt::ui::app::mixer_screen { BusPane::BusPane(SCXTEditor *e, MixerScreen *m) @@ -87,4 +87,4 @@ void BusPane::resized() channelStrips[0]->setBounds(mb); } -} // namespace scxt::ui::mixer \ No newline at end of file +} // namespace scxt::ui::app::mixer_screen \ No newline at end of file diff --git a/src-ui/components/mixer/BusPane.h b/src-ui/app/mixer-screen/components/BusPane.h similarity index 91% rename from src-ui/components/mixer/BusPane.h rename to src-ui/app/mixer-screen/components/BusPane.h index 267f3adb..c83f4261 100644 --- a/src-ui/components/mixer/BusPane.h +++ b/src-ui/app/mixer-screen/components/BusPane.h @@ -34,12 +34,12 @@ #include "configuration.h" -#include "components/HasEditor.h" -#include "components/MixerScreen.h" +#include "app/HasEditor.h" +#include "app/mixer-screen//MixerScreen.h" #include "ChannelStrip.h" -namespace scxt::ui::mixer +namespace scxt::ui::app::mixer_screen { struct BusPane : public HasEditor, public sst::jucegui::components::NamedPanel @@ -54,6 +54,6 @@ struct BusPane : public HasEditor, public sst::jucegui::components::NamedPanel BusPane(SCXTEditor *e, MixerScreen *m); void resized() override; }; -} // namespace scxt::ui::mixer +} // namespace scxt::ui::app::mixer_screen #endif // SHORTCIRCUITXT_BUSPANEL_H diff --git a/src-ui/components/mixer/ChannelStrip.cpp b/src-ui/app/mixer-screen/components/ChannelStrip.cpp similarity index 98% rename from src-ui/components/mixer/ChannelStrip.cpp rename to src-ui/app/mixer-screen/components/ChannelStrip.cpp index 5b307c8c..40e0c49b 100644 --- a/src-ui/components/mixer/ChannelStrip.cpp +++ b/src-ui/app/mixer-screen/components/ChannelStrip.cpp @@ -27,14 +27,16 @@ #include "configuration.h" #include "ChannelStrip.h" +#include "messaging/messaging.h" #include +#include "app/SCXTEditor.h" -namespace scxt::ui::mixer +namespace scxt::ui::app::mixer_screen { namespace jcmp = sst::jucegui::components; namespace cmsg = scxt::messaging::client; -ChannelStrip::ChannelStrip(scxt::ui::SCXTEditor *e, MixerScreen *m, int bi, BusType t) +ChannelStrip::ChannelStrip(SCXTEditor *e, MixerScreen *m, int bi, BusType t) : HasEditor(e), jcmp::NamedPanel(""), mixer(m), busIndex(bi), type(t) { centeredHeader = true; @@ -368,4 +370,4 @@ void ChannelStrip::labelPluginOutput() else outputMenu->setLabel("OUT " + std::to_string(cr + 1)); } -} // namespace scxt::ui::mixer \ No newline at end of file +} // namespace scxt::ui::app::mixer_screen \ No newline at end of file diff --git a/src-ui/components/mixer/ChannelStrip.h b/src-ui/app/mixer-screen/components/ChannelStrip.h similarity index 96% rename from src-ui/components/mixer/ChannelStrip.h rename to src-ui/app/mixer-screen/components/ChannelStrip.h index 08520979..86e064d0 100644 --- a/src-ui/components/mixer/ChannelStrip.h +++ b/src-ui/app/mixer-screen/components/ChannelStrip.h @@ -29,8 +29,8 @@ #define SCXT_SRC_UI_COMPONENTS_MIXER_CHANNELSTRIP_H #include "engine/bus.h" -#include "components/HasEditor.h" -#include "components/MixerScreen.h" +#include "app/HasEditor.h" +#include "app/mixer-screen/MixerScreen.h" #include "sst/jucegui/components/Label.h" #include "sst/jucegui/components/NamedPanel.h" #include "sst/jucegui/components/HSliderFilled.h" @@ -43,7 +43,7 @@ #include "connectors/PayloadDataAttachment.h" -namespace scxt::ui::mixer +namespace scxt::ui::app::mixer_screen { struct ChannelStrip : public HasEditor, sst::jucegui::components::NamedPanel { @@ -120,5 +120,5 @@ struct ChannelStrip : public HasEditor, sst::jucegui::components::NamedPanel vuR = R; } }; -}; // namespace scxt::ui::mixer +} // namespace scxt::ui::app::mixer_screen #endif // SHORTCIRCUITXT_CHANNELSTRIP_H diff --git a/src-ui/components/mixer/PartEffectsPane.cpp b/src-ui/app/mixer-screen/components/PartEffectsPane.cpp similarity index 99% rename from src-ui/components/mixer/PartEffectsPane.cpp rename to src-ui/app/mixer-screen/components/PartEffectsPane.cpp index bc0cf128..a6ca3726 100644 --- a/src-ui/components/mixer/PartEffectsPane.cpp +++ b/src-ui/app/mixer-screen/components/PartEffectsPane.cpp @@ -26,8 +26,8 @@ */ #include "PartEffectsPane.h" -#include "components/SCXTEditor.h" -#include "components/MixerScreen.h" +#include "app/SCXTEditor.h" +#include "app/mixer-screen/MixerScreen.h" #include "connectors/JSONAssetSupport.h" @@ -38,7 +38,7 @@ #include "sst/jucegui/components/JogUpDownButton.h" #include "sst/jucegui/layouts/ExplicitLayout.h" -namespace scxt::ui::mixer +namespace scxt::ui::app::mixer_screen { namespace cmsg = scxt::messaging::client; namespace jcmp = sst::jucegui::components; @@ -495,4 +495,4 @@ template void PartEffectsPane::busEffectStorageChangedFromGUI(con sendToSerialization(cmsg::SetBusEffectStorage({busAddress, fxSlot, data.second})); } -} // namespace scxt::ui::mixer \ No newline at end of file +} // namespace scxt::ui::app::mixer_screen \ No newline at end of file diff --git a/src-ui/components/mixer/PartEffectsPane.h b/src-ui/app/mixer-screen/components/PartEffectsPane.h similarity index 97% rename from src-ui/components/mixer/PartEffectsPane.h rename to src-ui/app/mixer-screen/components/PartEffectsPane.h index 28019d47..9bc8dc48 100644 --- a/src-ui/components/mixer/PartEffectsPane.h +++ b/src-ui/app/mixer-screen/components/PartEffectsPane.h @@ -35,16 +35,14 @@ #include #include -#include "components/HasEditor.h" +#include "app/HasEditor.h" #include "connectors/PayloadDataAttachment.h" #include "engine/bus.h" -namespace scxt::ui +namespace scxt::ui::app::mixer_screen { struct MixerScreen; -} -namespace scxt::ui::mixer -{ + struct PartEffectsPane : public HasEditor, sst::jucegui::components::NamedPanel { @@ -122,6 +120,6 @@ struct PartEffectsPane : public HasEditor, sst::jucegui::components::NamedPanel // Specific // void rebuildDelayLayout(); }; -} // namespace scxt::ui::mixer +} // namespace scxt::ui::app::mixer_screen #endif // SHORTCIRCUITXT_PARTEFFECTSPANEL_H diff --git a/src-ui/components/AboutScreen.cpp b/src-ui/app/other-screens/AboutScreen.cpp similarity index 97% rename from src-ui/components/AboutScreen.cpp rename to src-ui/app/other-screens/AboutScreen.cpp index e5e14bcb..03baded1 100644 --- a/src-ui/components/AboutScreen.cpp +++ b/src-ui/app/other-screens/AboutScreen.cpp @@ -28,11 +28,11 @@ #include "AboutScreen.h" #include "utils.h" #include "sst/plugininfra/cpufeatures.h" -#include "SCXTEditor.h" +#include "app/SCXTEditor.h" #include -namespace scxt::ui +namespace scxt::ui::app::other_screens { AboutScreen::AboutScreen(SCXTEditor *e) : HasEditor(e) { @@ -147,4 +147,4 @@ void AboutScreen::visibilityChanged() if (isVisible()) resetInfo(); } -} // namespace scxt::ui \ No newline at end of file +} // namespace scxt::ui::app::other_screens \ No newline at end of file diff --git a/src-ui/components/AboutScreen.h b/src-ui/app/other-screens/AboutScreen.h similarity index 94% rename from src-ui/components/AboutScreen.h rename to src-ui/app/other-screens/AboutScreen.h index 2beedeb0..07ad96d1 100644 --- a/src-ui/components/AboutScreen.h +++ b/src-ui/app/other-screens/AboutScreen.h @@ -28,10 +28,10 @@ #ifndef SCXT_SRC_UI_COMPONENTS_ABOUTSCREEN_H #define SCXT_SRC_UI_COMPONENTS_ABOUTSCREEN_H -#include "HasEditor.h" +#include "app/HasEditor.h" #include -namespace scxt::ui +namespace scxt::ui::app::other_screens { struct AboutScreen : juce::Component, HasEditor { @@ -63,6 +63,6 @@ struct AboutScreen : juce::Component, HasEditor JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AboutScreen); }; -} // namespace scxt::ui +} // namespace scxt::ui::app::other_screens #endif // SCXT_SRC_UI_COMPONENTS_ABOUTSCREEN_H diff --git a/src-ui/components/LogScreen.cpp b/src-ui/app/other-screens/LogScreen.cpp similarity index 95% rename from src-ui/components/LogScreen.cpp rename to src-ui/app/other-screens/LogScreen.cpp index 693162f0..069805d0 100644 --- a/src-ui/components/LogScreen.cpp +++ b/src-ui/app/other-screens/LogScreen.cpp @@ -29,10 +29,10 @@ #include "utils.h" #include "sst/plugininfra/cpufeatures.h" -#include "SCXTEditor.h" +#include "app/SCXTEditor.h" #include "connectors/SCXTResources.h" -namespace scxt::ui +namespace scxt::ui::app::other_screens { LogScreen::LogScreen(SCXTEditor *e) : HasEditor(e) { @@ -87,4 +87,4 @@ bool LogScreen::keyPressed(const juce::KeyPress &key) } return false; } -} // namespace scxt::ui \ No newline at end of file +} // namespace scxt::ui::app::other_screens \ No newline at end of file diff --git a/src-ui/components/LogScreen.h b/src-ui/app/other-screens/LogScreen.h similarity index 94% rename from src-ui/components/LogScreen.h rename to src-ui/app/other-screens/LogScreen.h index aeadcf24..8b90b6d0 100644 --- a/src-ui/components/LogScreen.h +++ b/src-ui/app/other-screens/LogScreen.h @@ -28,10 +28,10 @@ #ifndef SCXT_SRC_UI_COMPONENTS_LOGSCREEN_H #define SCXT_SRC_UI_COMPONENTS_LOGSCREEN_H -#include "HasEditor.h" +#include "app/HasEditor.h" #include -namespace scxt::ui +namespace scxt::ui::app::other_screens { struct LogScreen : juce::Component, HasEditor { @@ -52,6 +52,6 @@ struct LogScreen : juce::Component, HasEditor JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(LogScreen); }; -} // namespace scxt::ui +} // namespace scxt::ui::app::other_screens #endif // SHORTCIRCUIT_ABOUTESCREEN_H diff --git a/src-ui/components/WelcomeScreen.cpp b/src-ui/app/other-screens/WelcomeScreen.cpp similarity index 96% rename from src-ui/components/WelcomeScreen.cpp rename to src-ui/app/other-screens/WelcomeScreen.cpp index 97bf4604..5414fa0d 100644 --- a/src-ui/components/WelcomeScreen.cpp +++ b/src-ui/app/other-screens/WelcomeScreen.cpp @@ -28,12 +28,10 @@ #include "WelcomeScreen.h" #include "utils.h" -#include "sst/plugininfra/cpufeatures.h" -#include "SCXTEditor.h" -#include "connectors/SCXTResources.h" +#include "app/SCXTEditor.h" #include "infrastructure/user_defaults.h" -namespace scxt::ui +namespace scxt::ui::app::other_screens { WelcomeScreen::WelcomeScreen(SCXTEditor *e) : HasEditor(e) { @@ -107,4 +105,4 @@ void WelcomeScreen::paint(juce::Graphics &g) auto tb = bd.reduced(10, 120); g.drawFittedText(txt, tb, juce::Justification::topLeft, 50); } -} // namespace scxt::ui \ No newline at end of file +} // namespace scxt::ui::app::other_screens \ No newline at end of file diff --git a/src-ui/components/WelcomeScreen.h b/src-ui/app/other-screens/WelcomeScreen.h similarity index 94% rename from src-ui/components/WelcomeScreen.h rename to src-ui/app/other-screens/WelcomeScreen.h index 07069ef2..aee44ca0 100644 --- a/src-ui/components/WelcomeScreen.h +++ b/src-ui/app/other-screens/WelcomeScreen.h @@ -30,9 +30,9 @@ #include #include "sst/jucegui/components/TextPushButton.h" -#include "HasEditor.h" +#include "app/HasEditor.h" -namespace scxt::ui +namespace scxt::ui::app::other_screens { struct WelcomeScreen : juce::Component, HasEditor { @@ -53,5 +53,5 @@ struct WelcomeScreen : juce::Component, HasEditor JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(WelcomeScreen); }; -} // namespace scxt::ui +} // namespace scxt::ui::app::other_screens #endif // SHORTCIRCUITXT_WELCOMESCREEN_H diff --git a/src-ui/components/PlayScreen.cpp b/src-ui/app/play-screen/PlayScreen.cpp similarity index 86% rename from src-ui/components/PlayScreen.cpp rename to src-ui/app/play-screen/PlayScreen.cpp index e8a009e1..cbaf3bff 100644 --- a/src-ui/components/PlayScreen.cpp +++ b/src-ui/app/play-screen/PlayScreen.cpp @@ -27,11 +27,11 @@ #include "PlayScreen.h" #include "utils.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "infrastructure/user_defaults.h" -#include "browser/BrowserPane.h" +#include "app/browser-ui/BrowserPane.h" -namespace scxt::ui +namespace scxt::ui::app::play_screen { namespace jcmp = sst::jucegui::components; @@ -53,15 +53,15 @@ struct ViewportComponent : juce::Component, HasEditor auto bx = playScreen->rectangleForPart(i).withTrimmedBottom(PlayScreen::interPartMargin); g.drawRoundedRectangle(bx.toFloat(), 2, 1); - g.drawVerticalLine(bx.getX() + multi::PartSidebarCard::width, bx.getY(), + g.drawVerticalLine(bx.getX() + shared::PartSidebarCard::width, bx.getY(), bx.getY() + bx.getHeight()); } } }; -PlayScreen::PlayScreen(scxt::ui::SCXTEditor *e) : HasEditor(e) +PlayScreen::PlayScreen(SCXTEditor *e) : HasEditor(e) { - browser = std::make_unique(editor); + browser = std::make_unique(editor); addAndMakeVisible(*browser); playNamedPanel = std::make_unique("PARTS"); @@ -77,7 +77,7 @@ PlayScreen::PlayScreen(scxt::ui::SCXTEditor *e) : HasEditor(e) viewportContents = std::make_unique(this, editor); for (int i = 0; i < scxt::numParts; ++i) { - partSidebars[i] = std::make_unique(i, editor); + partSidebars[i] = std::make_unique(i, editor); partSidebars[i]->selfAccent = false; viewportContents->addAndMakeVisible(*partSidebars[i]); @@ -104,7 +104,7 @@ PlayScreen::PlayScreen(scxt::ui::SCXTEditor *e) : HasEditor(e) int id{0}; for (auto &sed : ped) { - sed = std::make_unique(editor, pt, id, true); + sed = std::make_unique(editor, pt, id, true); sed->changePart(pt); id++; viewportContents->addAndMakeVisible(*sed); @@ -202,13 +202,13 @@ void PlayScreen::resized() viewport->setBounds(playNamedPanel->getContentArea()); auto w = viewport->getWidth() - viewport->getScrollBarThickness() - 2; viewportContents->setBounds( - 0, 0, w, multi::PartSidebarCard::height * scxt::numParts * (tallMode ? 2 : 1)); + 0, 0, w, shared::PartSidebarCard::height * scxt::numParts * (tallMode ? 2 : 1)); for (int i = 0; i < scxt::numParts; ++i) { auto rb = rectangleForPart(i); - partSidebars[i]->setBounds( - rb.withWidth(multi::PartSidebarCard::width).withHeight(multi::PartSidebarCard::height)); + partSidebars[i]->setBounds(rb.withWidth(shared::PartSidebarCard::width) + .withHeight(shared::PartSidebarCard::height)); } int pt{0}; @@ -219,7 +219,7 @@ void PlayScreen::resized() auto pBox = rectangleForPart(pt); // write it this way to make tall mode easier in the future - auto totalS = w - multi::PartSidebarCard::width - knobMargin; + auto totalS = w - shared::PartSidebarCard::width - knobMargin; int switchW = 32; if (!tallMode) totalS -= switchW - 2 * knobMargin; @@ -227,17 +227,17 @@ void PlayScreen::resized() auto wid = (totalS - 2 * off) / (macrosPerPart / 2); for (int idx = 0; idx < macrosPerPart; idx++) { - int xPos = multi::PartSidebarCard::width + knobMargin + off + + int xPos = shared::PartSidebarCard::width + knobMargin + off + wid * (idx % (macrosPerPart / 2)); int yPos = pBox.getY(); if (tallMode) { if (idx >= macrosPerPart / 2) { - yPos += multi::PartSidebarCard::height; + yPos += shared::PartSidebarCard::height; } } - auto bx = juce::Rectangle(xPos, yPos, 92, multi::PartSidebarCard::height); + auto bx = juce::Rectangle(xPos, yPos, 92, shared::PartSidebarCard::height); macroEditors[pt][idx]->setBounds(bx.reduced(3)); } if (!tallMode) @@ -259,9 +259,9 @@ juce::Rectangle PlayScreen::rectangleForPart(int part) auto b = viewportContents->getLocalBounds(); auto xp{0}; auto w{b.getWidth()}; - auto h{multi::PartSidebarCard::height * (tallMode ? 2 : 1) + interPartMargin}; + auto h{shared::PartSidebarCard::height * (tallMode ? 2 : 1) + interPartMargin}; auto yp{h * part}; return {xp, (int)yp, w, (int)h}; } -} // namespace scxt::ui \ No newline at end of file +} // namespace scxt::ui::app::play_screen \ No newline at end of file diff --git a/src-ui/components/PlayScreen.h b/src-ui/app/play-screen/PlayScreen.h similarity index 84% rename from src-ui/components/PlayScreen.h rename to src-ui/app/play-screen/PlayScreen.h index 02efcf65..0829b0e2 100644 --- a/src-ui/components/PlayScreen.h +++ b/src-ui/app/play-screen/PlayScreen.h @@ -32,30 +32,32 @@ #include #include #include "configuration.h" -#include "HasEditor.h" +#include "app/HasEditor.h" #include "sst/jucegui/components/Viewport.h" #include "sst/jucegui/components/NamedPanel.h" #include "sst/jucegui/components/MultiSwitch.h" #include "sst/jucegui/component-adapters/DiscreteToReference.h" -#include "multi/PartSidebarCard.h" -#include "multi/SingleMacroEditor.h" +#include "app/shared/PartSidebarCard.h" +#include "app/shared/SingleMacroEditor.h" -namespace scxt::ui +namespace scxt::ui::app { -namespace browser +namespace browser_ui { struct BrowserPane; } +namespace play_screen +{ struct PlayScreen : juce::Component, HasEditor { static constexpr int browserPanelWidth = 196; // copied from multi for now - std::array, scxt::macrosPerPart>, + std::array, scxt::macrosPerPart>, scxt::numParts> macroEditors; - std::array, scxt::numParts> partSidebars; + std::array, scxt::numParts> partSidebars; std::unique_ptr viewport; std::unique_ptr viewportContents; @@ -65,7 +67,7 @@ struct PlayScreen : juce::Component, HasEditor std::array skinnyPage{}; std::unique_ptr playNamedPanel; - std::unique_ptr browser; + std::unique_ptr browser; PlayScreen(SCXTEditor *e); ~PlayScreen(); @@ -83,5 +85,6 @@ struct PlayScreen : juce::Component, HasEditor static constexpr size_t sidebarWidth{180}; }; -} // namespace scxt::ui +} // namespace play_screen +} // namespace scxt::ui::app #endif // SHORTCIRCUITXT_PLAYSCREEN_H diff --git a/src-ui/components/HeaderRegion.cpp b/src-ui/app/shared/HeaderRegion.cpp similarity index 99% rename from src-ui/components/HeaderRegion.cpp rename to src-ui/app/shared/HeaderRegion.cpp index 1ac18703..12479629 100644 --- a/src-ui/components/HeaderRegion.cpp +++ b/src-ui/app/shared/HeaderRegion.cpp @@ -26,12 +26,12 @@ */ #include "HeaderRegion.h" -#include "SCXTEditor.h" +#include "app/SCXTEditor.h" #include "sst/jucegui/components/ToggleButton.h" #include "sst/jucegui/components/ToggleButtonRadioGroup.h" #include "sst/jucegui/data/Discrete.h" -namespace scxt::ui +namespace scxt::ui::app::shared { namespace cmsg = scxt::messaging::client; @@ -332,4 +332,4 @@ void HeaderRegion::showMultiSelectionMenu() p.showMenuAsync(editor->defaultPopupMenuOptions(multiMenuButton.get())); } -} // namespace scxt::ui \ No newline at end of file +} // namespace scxt::ui::app::shared \ No newline at end of file diff --git a/src-ui/components/HeaderRegion.h b/src-ui/app/shared/HeaderRegion.h similarity index 97% rename from src-ui/components/HeaderRegion.h rename to src-ui/app/shared/HeaderRegion.h index 06eccd79..10699240 100644 --- a/src-ui/components/HeaderRegion.h +++ b/src-ui/app/shared/HeaderRegion.h @@ -41,12 +41,11 @@ #include "sst/jucegui/components/ToggleButtonRadioGroup.h" #include "sst/jucegui/data/Discrete.h" -#include "HasEditor.h" +#include "app/HasEditor.h" #include "utils.h" -namespace scxt::ui +namespace scxt::ui::app::shared { -struct SCXTEditor; struct HeaderRegion : juce::Component, HasEditor, juce::FileDragAndDropTarget { @@ -115,6 +114,6 @@ struct HeaderRegion : juce::Component, HasEditor, juce::FileDragAndDropTarget std::unique_ptr fileChooser; }; -} // namespace scxt::ui +} // namespace scxt::ui::app::shared #endif // SHORTCIRCUIT_HEADERREGION_H diff --git a/src-ui/components/multi/PartSidebarCard.cpp b/src-ui/app/shared/PartSidebarCard.cpp similarity index 98% rename from src-ui/components/multi/PartSidebarCard.cpp rename to src-ui/app/shared/PartSidebarCard.cpp index b6924d35..1d696761 100644 --- a/src-ui/components/multi/PartSidebarCard.cpp +++ b/src-ui/app/shared/PartSidebarCard.cpp @@ -28,9 +28,9 @@ #include "PartSidebarCard.h" #include "sst/jucegui/components/GlyphPainter.h" #include "messaging/messaging.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" -namespace scxt::ui::multi +namespace scxt::ui::app::shared { namespace cmsg = scxt::messaging::client; namespace jcmp = sst::jucegui::components; @@ -221,4 +221,4 @@ void PartSidebarCard::resetFromEditorCache() } repaint(); } -} // namespace scxt::ui::multi \ No newline at end of file +} // namespace scxt::ui::app::shared \ No newline at end of file diff --git a/src-ui/components/multi/PartSidebarCard.h b/src-ui/app/shared/PartSidebarCard.h similarity index 96% rename from src-ui/components/multi/PartSidebarCard.h rename to src-ui/app/shared/PartSidebarCard.h index a4a8b39b..f94e66a0 100644 --- a/src-ui/components/multi/PartSidebarCard.h +++ b/src-ui/app/shared/PartSidebarCard.h @@ -33,11 +33,11 @@ #include "sst/jucegui/components/ToggleButton.h" #include "sst/jucegui/components/TextPushButton.h" #include "sst/jucegui/components/HSliderFilled.h" -#include "components/HasEditor.h" +#include "app/HasEditor.h" #include "connectors/PayloadDataAttachment.h" #include "engine/part.h" -namespace scxt::ui::multi +namespace scxt::ui::app::shared { struct PartSidebarCard : juce::Component, HasEditor { @@ -66,5 +66,5 @@ struct PartSidebarCard : juce::Component, HasEditor void resetFromEditorCache(); }; -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::shared #endif // SHORTCIRCUITXT_PARTSIDEBARCARD_H diff --git a/src-ui/components/multi/SingleMacroEditor.cpp b/src-ui/app/shared/SingleMacroEditor.cpp similarity index 99% rename from src-ui/components/multi/SingleMacroEditor.cpp rename to src-ui/app/shared/SingleMacroEditor.cpp index 1a13d156..e5d09140 100644 --- a/src-ui/components/multi/SingleMacroEditor.cpp +++ b/src-ui/app/shared/SingleMacroEditor.cpp @@ -26,13 +26,13 @@ */ #include "SingleMacroEditor.h" -#include "components/SCXTEditor.h" +#include "app/SCXTEditor.h" #include "connectors/PayloadDataAttachment.h" #include "sst/jucegui/components/GlyphPainter.h" #include "sst/jucegui/components/NamedPanel.h" #include "messaging/client/client_messages.h" -namespace scxt::ui::multi +namespace scxt::ui::app::shared { struct MacroValueAttachment : HasEditor, sst::jucegui::data::Continuous { @@ -298,4 +298,4 @@ void SingleMacroEditor::textEditorFocusLost(juce::TextEditor &e) sendToSerialization(scxt::messaging::client::SetMacroFullState({part, index, macro})); } -} // namespace scxt::ui::multi \ No newline at end of file +} // namespace scxt::ui::app::shared \ No newline at end of file diff --git a/src-ui/components/multi/SingleMacroEditor.h b/src-ui/app/shared/SingleMacroEditor.h similarity index 96% rename from src-ui/components/multi/SingleMacroEditor.h rename to src-ui/app/shared/SingleMacroEditor.h index 42eb14dc..0871173d 100644 --- a/src-ui/components/multi/SingleMacroEditor.h +++ b/src-ui/app/shared/SingleMacroEditor.h @@ -32,9 +32,9 @@ #include "sst/jucegui/components/Knob.h" #include "sst/jucegui/components/Label.h" #include "sst/jucegui/style/StyleAndSettingsConsumer.h" -#include "components/HasEditor.h" +#include "app/HasEditor.h" -namespace scxt::ui::multi +namespace scxt::ui::app::shared { struct MacroValueAttachment; struct SingleMacroEditor : HasEditor, @@ -65,5 +65,5 @@ struct SingleMacroEditor : HasEditor, int16_t part{-1}, index{-1}; bool valueOnly{false}; }; -} // namespace scxt::ui::multi +} // namespace scxt::ui::app::shared #endif // SHORTCIRCUITXT_SINGLEMACROEDITOR_H diff --git a/src-ui/components/SendFXScreen.cpp b/src-ui/components/SendFXScreen.cpp deleted file mode 100644 index fc2e7dae..00000000 --- a/src-ui/components/SendFXScreen.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Shortcircuit XT - a Surge Synth Team product - * - * A fully featured creative sampler, available as a standalone - * and plugin for multiple platforms. - * - * Copyright 2019 - 2024, Various authors, as described in the github - * transaction log. - * - * ShortcircuitXT is released under the Gnu General Public Licence - * V3 or later (GPL-3.0-or-later). The license is found in the file - * "LICENSE" in the root of this repository or at - * https://www.gnu.org/licenses/gpl-3.0.en.html - * - * Individual sections of code which comprises ShortcircuitXT in this - * repository may also be used under an MIT license. Please see the - * section "Licensing" in "README.md" for details. - * - * ShortcircuitXT is inspired by, and shares code with, the - * commercial product Shortcircuit 1 and 2, released by VemberTech - * in the mid 2000s. The code for Shortcircuit 2 was opensourced in - * 2020 at the outset of this project. - * - * All source for ShortcircuitXT is available at - * https://github.com/surge-synthesizer/shortcircuit-xt - */ - -#include "MixerScreen.h" diff --git a/src-ui/connectors/PayloadDataAttachment.h b/src-ui/connectors/PayloadDataAttachment.h index 0a0f46d5..7c474c76 100644 --- a/src-ui/connectors/PayloadDataAttachment.h +++ b/src-ui/connectors/PayloadDataAttachment.h @@ -37,13 +37,13 @@ #include "sst/jucegui/data/Discrete.h" #include "datamodel/metadata.h" #include "sample/sample.h" -#include "components/HasEditor.h" +#include "app/HasEditor.h" namespace scxt::ui::connectors { template -inline void updateSingleValue(const P &p, V &value, HasEditor *e, Args... args) +inline void updateSingleValue(const P &p, V &value, app::HasEditor *e, Args... args) { static_assert(std::is_standard_layout_v

); @@ -62,7 +62,7 @@ inline void updateSingleValue(const P &p, V &value, HasEditor *e, Args... args) template inline std::function makeUpdater(A &att, const typename A::payload_t &p, - HasEditor *e, Args... args) + app::HasEditor *e, Args... args) { static_assert(std::is_standard_layout_v); @@ -97,7 +97,8 @@ inline std::function makeUpdater(A &att, const typename A:: } template -inline void configureUpdater(A &att, const typename A::payload_t &p, HasEditor *e, Args... args) +inline void configureUpdater(A &att, const typename A::payload_t &p, app::HasEditor *e, + Args... args) { att.onGuiValueChanged = makeUpdater(att, p, e, std::forward(args)...); } @@ -449,7 +450,7 @@ template struct SingleValueFactor template static std::pair, std::unique_ptr> attachR(const datamodel::pmd &md, const typename A::payload_t &p, typename A::value_t &val, - HasEditor *e, Args... args) + app::HasEditor *e, Args... args) { auto att = std::make_unique(md, val); configureUpdater(*att, p, e, std::forward(args)...); @@ -467,7 +468,7 @@ template struct SingleValueFactor } template - static void attach(const typename A::payload_t &p, typename A::value_t &val, HasEditor *e, + static void attach(const typename A::payload_t &p, typename A::value_t &val, app::HasEditor *e, std::unique_ptr &aRes, std::unique_ptr &wRes, Args... args) { auto md = scxt::datamodel::describeValue(p, val); @@ -479,7 +480,7 @@ template struct SingleValueFactor template static void attach(const datamodel::pmd &md, const typename A::payload_t &p, - typename A::value_t &val, HasEditor *e, std::unique_ptr &aRes, + typename A::value_t &val, app::HasEditor *e, std::unique_ptr &aRes, std::unique_ptr &wRes, Args... args) { auto [a, w] = attachR(md, p, val, e, std::forward(args)...); @@ -489,7 +490,7 @@ template struct SingleValueFactor template static void attachAndAdd(const datamodel::pmd &md, const typename A::payload_t &p, - typename A::value_t &val, HasEditor *e, std::unique_ptr &aRes, + typename A::value_t &val, app::HasEditor *e, std::unique_ptr &aRes, std::unique_ptr &wRes, Args... args) { auto [a, w] = attachR(md, p, val, e, std::forward(args)...); @@ -504,8 +505,9 @@ template struct SingleValueFactor } template - static void attachAndAdd(const typename A::payload_t &p, typename A::value_t &val, HasEditor *e, - std::unique_ptr &aRes, std::unique_ptr &wRes, Args... args) + static void attachAndAdd(const typename A::payload_t &p, typename A::value_t &val, + app::HasEditor *e, std::unique_ptr &aRes, std::unique_ptr &wRes, + Args... args) { auto md = scxt::datamodel::describeValue(p, val); attachAndAdd(md, p, val, e, aRes, wRes, std::forward(args)...); @@ -513,8 +515,9 @@ template struct SingleValueFactor template static void attachLabelAndAdd(const datamodel::pmd &md, const typename A::payload_t &p, - typename A::value_t &val, HasEditor *e, std::unique_ptr &aRes, - std::unique_ptr &wRes, const std::string &lab, Args... args) + typename A::value_t &val, app::HasEditor *e, + std::unique_ptr &aRes, std::unique_ptr &wRes, + const std::string &lab, Args... args) { assert(!wRes); wRes = std::make_unique(); @@ -535,8 +538,8 @@ template struct SingleValueFactor template static void attachLabelAndAdd(const typename A::payload_t &p, typename A::value_t &val, - HasEditor *e, std::unique_ptr &aRes, std::unique_ptr &wRes, - const std::string &lab, Args... args) + app::HasEditor *e, std::unique_ptr &aRes, + std::unique_ptr &wRes, const std::string &lab, Args... args) { auto md = scxt::datamodel::describeValue(p, val); attachLabelAndAdd(md, p, val, e, aRes, wRes, lab, std::forward(args)...); diff --git a/src-ui/theme/ThemeApplier.cpp b/src-ui/theme/ThemeApplier.cpp index a5b05d97..5100431a 100644 --- a/src-ui/theme/ThemeApplier.cpp +++ b/src-ui/theme/ThemeApplier.cpp @@ -62,7 +62,7 @@ namespace global void applyColors(const sheet_t::ptr_t &base, const ColorMap &cols); } // namespace global -namespace multi +namespace edit { static constexpr sheet_t::Class ModulationJogButon{"multi.modulation.jogbutton"}; static constexpr sheet_t::Class ModulationToggle{"multi.modulation.toggle"}; @@ -123,7 +123,7 @@ void init() } } // namespace group -} // namespace multi +} // namespace edit namespace header { static constexpr sheet_t::Class TextPushButton{"header.textbutton"}; @@ -155,9 +155,9 @@ ThemeApplier::ThemeApplier() static bool detailInitialized{false}; if (!detailInitialized) { - detail::multi::init(); - detail::multi::zone::init(); - detail::multi::group::init(); + detail::edit::init(); + detail::edit::zone::init(); + detail::edit::group::init(); detail::header::init(); detail::util::init(); detailInitialized = true; @@ -168,9 +168,9 @@ ThemeApplier::ThemeApplier() void ThemeApplier::recolorStylesheet(const sst::jucegui::style::StyleSheet::ptr_t &s) { detail::global::applyColors(s, *colors); - detail::multi::applyColors(s, *colors); - detail::multi::zone::applyColors(s, *colors); - detail::multi::group::applyColors(s, *colors); + detail::edit::applyColors(s, *colors); + detail::edit::zone::applyColors(s, *colors); + detail::edit::group::applyColors(s, *colors); detail::header::applyColorsAndFonts(s, *colors, *this); detail::util::applyColors(s, *colors); } @@ -183,18 +183,18 @@ void ThemeApplier::recolorStylesheetWith(std::unique_ptr &&c, const sh void populateSharedGroupZoneMultiModulation(jstl::CustomTypeMap &map) { - map.addCustomClass(detail::multi::ModulationJogButon); - map.addCustomClass(detail::multi::ModulationToggle); - map.addCustomClass(detail::multi::ModulationMenu); - map.addCustomClass(detail::multi::ModulationHSliderFilled); + map.addCustomClass(detail::edit::ModulationJogButon); + map.addCustomClass(detail::edit::ModulationToggle); + map.addCustomClass(detail::edit::ModulationMenu); + map.addCustomClass(detail::edit::ModulationHSliderFilled); } void ThemeApplier::applyZoneMultiScreenModulationTheme(juce::Component *toThis) { jstl::CustomTypeMap map; - map.addCustomClass(detail::multi::zone::ModulationNamedPanel); - map.addCustomClass(detail::multi::zone::ModulationMultiSwitch); - map.addCustomClass(detail::multi::zone::ModulationVSlider); - map.addCustomClass(detail::multi::zone::ModulationKnob); + map.addCustomClass(detail::edit::zone::ModulationNamedPanel); + map.addCustomClass(detail::edit::zone::ModulationMultiSwitch); + map.addCustomClass(detail::edit::zone::ModulationVSlider); + map.addCustomClass(detail::edit::zone::ModulationKnob); populateSharedGroupZoneMultiModulation(map); map.applyMapTo(toThis); } @@ -208,20 +208,20 @@ void ThemeApplier::applyZoneMultiScreenTheme(juce::Component *toThis) void ThemeApplier::applyGroupMultiScreenModulationTheme(juce::Component *toThis) { jstl::CustomTypeMap map; - map.addCustomClass(detail::multi::group::ModulationNamedPanel); - map.addCustomClass(detail::multi::group::ModulationMultiSwitch); - map.addCustomClass(detail::multi::group::NamedPanel); - map.addCustomClass(detail::multi::group::ModulationVSlider); - map.addCustomClass(detail::multi::group::ModulationKnob); + map.addCustomClass(detail::edit::group::ModulationNamedPanel); + map.addCustomClass(detail::edit::group::ModulationMultiSwitch); + map.addCustomClass(detail::edit::group::NamedPanel); + map.addCustomClass(detail::edit::group::ModulationVSlider); + map.addCustomClass(detail::edit::group::ModulationKnob); populateSharedGroupZoneMultiModulation(map); map.applyMapTo(toThis); } void ThemeApplier::applyGroupMultiScreenTheme(juce::Component *toThis) { jstl::CustomTypeMap map; - map.addCustomClass(detail::multi::group::MultiSwitch); - map.addCustomClass(detail::multi::group::NamedPanel); - map.addCustomClass(detail::multi::group::Knob); + map.addCustomClass(detail::edit::group::MultiSwitch); + map.addCustomClass(detail::edit::group::NamedPanel); + map.addCustomClass(detail::edit::group::Knob); map.applyMapTo(toThis); } @@ -388,7 +388,7 @@ void applyColors(const sheet_t::ptr_t &base, const ColorMap &cols) sst::jucegui::components::ToolTip::Styles::datafont, fw); } } // namespace global -namespace multi +namespace edit { void applyColors(const sheet_t::ptr_t &base, const ColorMap &cols) { @@ -489,7 +489,7 @@ void applyColors(const sheet_t::ptr_t &base, const ColorMap &cols) cols.get(ColorMap::accent_2a)); } } // namespace group -} // namespace multi +} // namespace edit namespace header { void applyColorsAndFonts(const sheet_t::ptr_t &base, const ColorMap &cols, const ThemeApplier &t) diff --git a/src-ui/theme/ThemeApplier.h b/src-ui/theme/ThemeApplier.h index 43355715..fc389176 100644 --- a/src-ui/theme/ThemeApplier.h +++ b/src-ui/theme/ThemeApplier.h @@ -38,7 +38,10 @@ namespace scxt::ui { +namespace app +{ struct SCXTEditor; +} namespace theme { struct ThemeApplier @@ -67,7 +70,7 @@ struct ThemeApplier juce::Font interRegularFor(int ht) const; juce::Font interLightFor(int ht) const; - friend scxt::ui::SCXTEditor; + friend scxt::ui::app::SCXTEditor; private: std::unique_ptr colors;