diff --git a/doc/NightlyBlurb.md b/doc/NightlyBlurb.md index f16a12c3..77ee6b80 100644 --- a/doc/NightlyBlurb.md +++ b/doc/NightlyBlurb.md @@ -1,16 +1,11 @@ -ShortCircuit XT is a sample-initiated instrument being actively developed -by the Surge Synth Team. The build below is our latest pre-alpha github version, but -it is very incomplete. +ShortCircuit XT is a sample-initiated instrument being actively developed by the Surge Synth Team. The build below is our latest pre-alpha github version, but it is very incomplete. -The instrument has many features incomplete, still has unresolved -crashing bugs, and may have DSP errors which cause unbounded -sound. Still, it is becoming more stable and usable and we -do have testers and developers running it. +The instrument has many features incomplete, still has unresolved crashing bugs, and may have DSP errors which cause unbounded sound. Still, it is becoming more stable and usable and we do have testers and developers running it. If you use ShortCircuit a few things of note: - You may want to use a limiter on the SC bus, in case there is a DSP error, and definitely do not use in-ear headphones - Most of the discussion about what works and doesn't happens on our discord. Please join! -- [This figma document](https://www.figma.com/proto/LWyY0E29tISj1djAp40EDL/ED-SST-Wireframes?node-id=3228-2774&starting-point-node-id=3228%3A2774) - serves as a design guide for where we are going +- [This figma document](https://www.figma.com/proto/LWyY0E29tISj1djAp40EDL/ED-SST-Wireframes?node-id=3228-2774&starting-point-node-id=3228%3A2774) serves as a design guide for where we are going - The more the merrier! If you are a dev jump in. + diff --git a/src-ui/components/multi/PartGroupSidebar.cpp b/src-ui/components/multi/PartGroupSidebar.cpp index afba3199..8d7d99a8 100644 --- a/src-ui/components/multi/PartGroupSidebar.cpp +++ b/src-ui/components/multi/PartGroupSidebar.cpp @@ -119,6 +119,7 @@ struct GroupZoneSidebarBase : juce::Component, HasEditor, juce::DragAndDropConta PartGroupSidebar *partGroupSidebar{nullptr}; std::unique_ptr listBox; std::unique_ptr> listBoxModel; + std::unique_ptr partSelector; T *asT() { return static_cast(this); } @@ -140,7 +141,42 @@ struct GroupZoneSidebarBase : juce::Component, HasEditor, juce::DragAndDropConta listBox->setColour(juce::ListBox::backgroundColourId, juce::Colour(0, 0, 0).withAlpha(0.f)); addAndMakeVisible(*listBox); + + partSelector = std::make_unique(); + partSelector->setOnCallback([w = juce::Component::SafePointer(this)]() { + if (w) + w->showPartSelectorMenu(); + }); + partSelector->setLabel("Part 1"); + addAndMakeVisible(*partSelector); + } + + void showPartSelectorMenu() + { + auto p = juce::PopupMenu(); + p.addSectionHeader("Part"); + p.addSeparator(); + for (int i = 0; i < scxt::numParts; ++i) + { + p.addItem("Part " + std::to_string(i + 1), true, i == editor->selectedPart, + [w = juce::Component::SafePointer(this), index = i]() { + w->sendToSerialization(cmsg::DoSelectPart(index)); + }); + } + p.showMenuAsync(editor->defaultPopupMenuOptions()); } + + void showSelectedPart(int part) { partSelector->setLabel("Part " + std::to_string(part + 1)); } + + juce::Rectangle baseResize() + { + auto r = getLocalBounds(); + auto pg = r.withHeight(22); + auto res = r.withTrimmedTop(24); + partSelector->setBounds(pg); + return res; + } + void addGroup() { auto &mc = partGroupSidebar->editor->msgCont; @@ -208,9 +244,10 @@ struct GroupSidebar : GroupZoneSidebarBase void resized() override { + auto b = baseResize(); auto ht = 200; - auto lb = getLocalBounds().withTrimmedBottom(ht); - auto cb = getLocalBounds().withY(lb.getBottom()).withHeight(ht); + auto lb = b.withTrimmedBottom(ht); + auto cb = b.withY(lb.getBottom()).withHeight(ht); listBox->setBounds(lb); groupControls->setBounds(cb); } @@ -260,7 +297,7 @@ struct ZoneSidebar : GroupZoneSidebarBase if (partGroupSidebar->editor->currentLeadZoneSelection.has_value()) lastZoneClicked = *(partGroupSidebar->editor->currentLeadZoneSelection); } - void resized() override { listBox->setBounds(getLocalBounds()); } + void resized() override { listBox->setBounds(baseResize()); } void processRowsChanged() { @@ -429,10 +466,14 @@ void PartGroupSidebar::setPartGroupZoneStructure(const engine::Engine::pgzStruct void PartGroupSidebar::selectedPartChanged() { + groupSidebar->showSelectedPart(editor->selectedPart); groupSidebar->listBoxModel->rebuild(); groupSidebar->listBox->updateContent(); + + zoneSidebar->showSelectedPart(editor->selectedPart); zoneSidebar->listBoxModel->rebuild(); zoneSidebar->listBox->updateContent(); + editorSelectionChanged(); repaint(); }