diff --git a/libs/sst/sst-jucegui b/libs/sst/sst-jucegui index 633ad0dd..eee0f392 160000 --- a/libs/sst/sst-jucegui +++ b/libs/sst/sst-jucegui @@ -1 +1 @@ -Subproject commit 633ad0dd8548b8da59c527342492807b297b108f +Subproject commit eee0f39245088ddbe4d67871a45d24fa9edc62ba diff --git a/src-ui/app/edit-screen/components/mapping-pane/SampleWaveform.cpp b/src-ui/app/edit-screen/components/mapping-pane/SampleWaveform.cpp index c94fafaf..ba481f18 100644 --- a/src-ui/app/edit-screen/components/mapping-pane/SampleWaveform.cpp +++ b/src-ui/app/edit-screen/components/mapping-pane/SampleWaveform.cpp @@ -393,7 +393,6 @@ void SampleWaveform::paint(juce::Graphics &g) } else { - g.setColour(juce::Colours::red); g.drawHorizontalLine((0.5 - vStart) * getHeight() * vZoom, 0, getWidth()); } diff --git a/src-ui/app/edit-screen/components/mapping-pane/VariantDisplay.cpp b/src-ui/app/edit-screen/components/mapping-pane/VariantDisplay.cpp index c47d8e66..193b609b 100644 --- a/src-ui/app/edit-screen/components/mapping-pane/VariantDisplay.cpp +++ b/src-ui/app/edit-screen/components/mapping-pane/VariantDisplay.cpp @@ -48,31 +48,39 @@ VariantDisplay::VariantDisplay(scxt::ui::app::edit_screen::MacroMappingVariantPa } variantPlayModeLabel = std::make_unique(); - variantPlayModeLabel->setText("Variant"); + variantPlayModeLabel->setText("Variants"); addAndMakeVisible(*variantPlayModeLabel); - variantPlaymodeButton = std::make_unique(); + variantPlaymodeButton = std::make_unique(); variantPlaymodeButton->setOnCallback([this]() { showVariantPlaymodeMenu(); }); addAndMakeVisible(*variantPlaymodeButton); + editAllButton = std::make_unique(); + editAllButton->setLabel("EDIT ALL"); + editAllButton->setOnCallback(editor->makeComingSoon("Edit All")); + addAndMakeVisible(*editAllButton); + fileLabel = std::make_unique(); fileLabel->setText("File"); addAndMakeVisible(*fileLabel); - fileButton = std::make_unique("file"); - fileButton->onClick = [this]() { showFileBrowser(); }; + fileButton = std::make_unique(); + fileButton->setOnCallback([this]() { showFileBrowser(); }); addAndMakeVisible(*fileButton); - nextFileButton = std::make_unique(">"); - nextFileButton->onClick = [this]() { selectNextFile(true); }; + nextFileButton = std::make_unique( + sst::jucegui::components::GlyphPainter::GlyphType::JOG_DOWN); + nextFileButton->setOnCallback([this]() { selectNextFile(true); }); addAndMakeVisible(*nextFileButton); - prevFileButton = std::make_unique("<"); - prevFileButton->onClick = [this]() { selectNextFile(false); }; + prevFileButton = std::make_unique( + sst::jucegui::components::GlyphPainter::GlyphType::JOG_UP); + prevFileButton->setOnCallback([this]() { selectNextFile(false); }); addAndMakeVisible(*prevFileButton); auto ms = std::make_unique(); - ms->setLabel("I"); + ms->setDrawMode(sst::jucegui::components::ToggleButton::DrawMode::GLYPH); + ms->setGlyph(sst::jucegui::components::GlyphPainter::GlyphType::SHOW_INFO); addAndMakeVisible(*ms); auto ds = std::make_unique(ms, fileInfoShowing); ds->onValueChanged = [w = juce::Component::SafePointer(this)](auto v) { @@ -304,21 +312,34 @@ void VariantDisplay::resized() loopDirectionButton->setBounds(p); - variantPlayModeLabel->setBounds({getWidth() / 2, 0, 40, p.getHeight()}); - variantPlaymodeButton->setBounds({variantPlayModeLabel->getRight(), 0, 60, p.getHeight()}); - - fileInfoButton->widget->setBounds( - {variantPlaymodeButton->getRight() + 5, 0, p.getHeight(), p.getHeight()}); - fileLabel->setBounds({fileInfoButton->widget->getRight(), 0, 30, p.getHeight()}); - fileButton->setBounds({fileLabel->getRight(), 0, 100, p.getHeight()}); - prevFileButton->setBounds({fileButton->getRight(), 0, p.getHeight(), p.getHeight()}); - nextFileButton->setBounds({prevFileButton->getRight(), 0, p.getHeight(), p.getHeight()}); - - fileInfos->setBounds({5, 20, getWidth(), 20}); + auto hl = getLocalBounds().withHeight(20).reduced(1).withTrimmedLeft(200); + auto hP = [&hl, this](int w) { + int margin{3}; + if (w < 0) + { + auto lbw = getLocalBounds().getWidth(); + auto spc = lbw - hl.getX() + w - margin; + w = spc; + } + auto r = hl.withWidth(w); + hl = hl.translated(w + margin, 0); + return r; + }; + variantPlayModeLabel->setBounds(hP(42)); + variantPlaymodeButton->setBounds(hP(100)); + editAllButton->setBounds(hP(100)); + fileInfoButton->widget->setBounds(hP(20)); + fileLabel->setBounds(hP(40)); + fileButton->setBounds(hP(-18)); + + auto jogs = hP(18); + prevFileButton->setBounds(jogs.withTrimmedBottom(jogs.getHeight() / 2)); + nextFileButton->setBounds(jogs.withTrimmedTop(jogs.getHeight() / 2)); + + fileInfos->setBounds({5, waveformsTabbedGroup->getY() + 20, getWidth(), 20}); } void VariantDisplay::rebuild() - { switch (variantView.variants[selectedVariation].playMode) { @@ -359,16 +380,16 @@ void VariantDisplay::rebuild() switch (variantView.variantPlaybackMode) { case engine::Zone::FORWARD_RR: - variantPlaymodeButton->setLabel("Round robin"); + variantPlaymodeButton->setLabel("ROUND ROBIN"); break; case engine::Zone::TRUE_RANDOM: - variantPlaymodeButton->setLabel("Random"); + variantPlaymodeButton->setLabel("RANDOM"); break; case engine::Zone::RANDOM_CYCLE: - variantPlaymodeButton->setLabel("Random per Cycle"); + variantPlaymodeButton->setLabel("EXCL RAND"); break; case engine::Zone::UNISON: - variantPlaymodeButton->setLabel("Unison"); + variantPlaymodeButton->setLabel("UNISON"); break; } @@ -380,7 +401,7 @@ void VariantDisplay::rebuild() a->sampleCount = samp->sample_length; } - fileButton->setButtonText(samp->displayName); + fileButton->setLabel(samp->displayName); fileInfos->srVal->setText(std::to_string(samp->sample_rate)); fileInfos->bdVal->setText(samp->getBitDepthText()); auto duration = ((float)samp->sample_length) / samp->sample_rate; @@ -576,7 +597,7 @@ void VariantDisplay::showVariantPlaymodeMenu() }; add(engine::Zone::VariantPlaybackMode::FORWARD_RR, "Round Robin"); add(engine::Zone::VariantPlaybackMode::TRUE_RANDOM, "Random"); - add(engine::Zone::VariantPlaybackMode::RANDOM_CYCLE, "Random per Cycle"); + add(engine::Zone::VariantPlaybackMode::RANDOM_CYCLE, "Random (exclusive)"); add(engine::Zone::VariantPlaybackMode::UNISON, "Unison"); p.showMenuAsync(editor->defaultPopupMenuOptions()); diff --git a/src-ui/app/edit-screen/components/mapping-pane/VariantDisplay.h b/src-ui/app/edit-screen/components/mapping-pane/VariantDisplay.h index 9f23917b..344cd6d1 100644 --- a/src-ui/app/edit-screen/components/mapping-pane/VariantDisplay.h +++ b/src-ui/app/edit-screen/components/mapping-pane/VariantDisplay.h @@ -35,6 +35,8 @@ #include "sst/jucegui/components/TabbedComponent.h" #include "sst/jucegui/components/ToggleButton.h" #include "sst/jucegui/components/TextPushButton.h" +#include "sst/jucegui/components/MenuButton.h" +#include "sst/jucegui/components/GlyphButton.h" #include "sst/jucegui/component-adapters/DiscreteToReference.h" #include "app/HasEditor.h" @@ -129,7 +131,7 @@ struct VariantDisplay : juce::Component, HasEditor juce::Rectangle sampleDisplayRegion() { - return getLocalBounds().withTrimmedRight(sidePanelWidth); + return getLocalBounds().withTrimmedRight(sidePanelWidth).withTrimmedTop(2); } void resized() override; @@ -167,16 +169,20 @@ struct VariantDisplay : juce::Component, HasEditor void showVariantPlaymodeMenu(); void showLoopDirectionMenu(); + // Header section using boolToggle_t = sst::jucegui::component_adapters::DiscreteToValueReference< sst::jucegui::components::ToggleButton, bool>; bool fileInfoShowing{false}; - - std::unique_ptr playModeLabel, variantPlayModeLabel, fileLabel; + std::unique_ptr variantPlaymodeButton, fileButton; + std::unique_ptr variantPlayModeLabel, fileLabel; std::unique_ptr fileInfoButton; + std::unique_ptr editAllButton; + std::unique_ptr nextFileButton, prevFileButton; + + // sidebar section + std::unique_ptr playModeLabel; - std::unique_ptr variantPlaymodeButton; - std::unique_ptr playModeButton, loopModeButton, loopDirectionButton, - fileButton, nextFileButton, prevFileButton; + std::unique_ptr playModeButton, loopModeButton, loopDirectionButton; struct FileInfos : juce::Component {