From f8977d6e37ef9fe64093282686072aa0ef88f655 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 1 Sep 2024 10:57:50 -0400 Subject: [PATCH] More sample tweaks around outlines, sample position, etc (#1239) Basically getting quite close now on part of the screen --- .../components/mapping-pane/SampleWaveform.cpp | 10 ++++++---- .../components/mapping-pane/SampleWaveform.h | 4 +++- .../components/mapping-pane/VariantDisplay.cpp | 5 +++-- src-ui/app/editor-impl/SCXTEditor.cpp | 11 ++++++++++- src-ui/app/editor-impl/SCXTJuceLookAndFeel.h | 4 ++++ 5 files changed, 26 insertions(+), 8 deletions(-) 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 2da75cd2..ceae7f11 100644 --- a/src-ui/app/edit-screen/components/mapping-pane/SampleWaveform.cpp +++ b/src-ui/app/edit-screen/components/mapping-pane/SampleWaveform.cpp @@ -164,7 +164,7 @@ void SampleWaveform::rebuildEnvelopePaths() seedmx = -100.f; seedmn = 100.f; } - auto mx = seedmn; + auto mx = seedmx; auto mn = seedmn; T normFactor{1}; @@ -207,7 +207,6 @@ void SampleWaveform::rebuildEnvelopePaths() jassertfalse; } - bool first{true}; upperFill[ch] = juce::Path(); upperStroke[ch] = juce::Path(); lowerFill[ch] = juce::Path(); @@ -229,6 +228,8 @@ void SampleWaveform::rebuildEnvelopePaths() return nval * getHeight() / 2 + getHeight() / 2; } }; + + bool first{true}; for (const auto &[smp, val] : topLine) { auto pos = xPixelForSample(smp); @@ -247,6 +248,7 @@ void SampleWaveform::rebuildEnvelopePaths() } } + first = true; for (const auto &[smp, val] : bottomLine) { auto pos = xPixelForSample(smp); @@ -583,7 +585,7 @@ void SampleWaveform::resized() void SampleWaveform::updateSamplePlaybackPosition(int64_t samplePos) { - auto x = xPixelForSample(samplePos); - samplePlaybackPosition.setTopLeftPosition(x, 0); + // auto x = xPixelForSample(samplePos); + // samplePlaybackPosition.setTopLeftPosition(x, 0); } } // namespace scxt::ui::app::edit_screen \ No newline at end of file diff --git a/src-ui/app/edit-screen/components/mapping-pane/SampleWaveform.h b/src-ui/app/edit-screen/components/mapping-pane/SampleWaveform.h index 451f811d..308576d9 100644 --- a/src-ui/app/edit-screen/components/mapping-pane/SampleWaveform.h +++ b/src-ui/app/edit-screen/components/mapping-pane/SampleWaveform.h @@ -72,7 +72,9 @@ struct SampleWaveform : juce::Component, HasEditor, sst::jucegui::components::Zo struct PlaybackCursor : juce::Component { - void paint(juce::Graphics &g) override { g.fillAll(juce::Colours::white); } + void paint(juce::Graphics &g) override + { /*g.fillAll(juce::Colours::white);*/ + } } samplePlaybackPosition; void updateSamplePlaybackPosition(int64_t samplePos); 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 d7ea0da5..df64d70f 100644 --- a/src-ui/app/edit-screen/components/mapping-pane/VariantDisplay.cpp +++ b/src-ui/app/edit-screen/components/mapping-pane/VariantDisplay.cpp @@ -236,18 +236,19 @@ void VariantDisplay::rebuildForSelectedVariation(size_t sel, bool rebuildTabs) if (rebuildTabs) { auto selectedTab{selectedVariation}; + auto bg2 = editor->themeColor(theme::ColorMap::bg_2); waveformsTabbedGroup->clearTabs(); for (auto i = 0; i < maxVariantsPerZone; ++i) { if (variantView.variants[i].active) { - waveformsTabbedGroup->addTab(std::to_string(i + 1), juce::Colours::darkgrey, + waveformsTabbedGroup->addTab(std::to_string(i + 1), bg2, waveforms[i].waveformViewport.get(), false, i); } } if (waveformsTabbedGroup->getNumTabs() < maxVariantsPerZone) { - waveformsTabbedGroup->addTab("+", juce::Colours::darkgrey, + waveformsTabbedGroup->addTab("+", bg2, waveforms[maxVariantsPerZone - 1].waveformViewport.get(), false, maxVariantsPerZone - 1); } diff --git a/src-ui/app/editor-impl/SCXTEditor.cpp b/src-ui/app/editor-impl/SCXTEditor.cpp index 5aef265f..00ab9ab6 100644 --- a/src-ui/app/editor-impl/SCXTEditor.cpp +++ b/src-ui/app/editor-impl/SCXTEditor.cpp @@ -232,13 +232,17 @@ void SCXTEditor::idle() } } +#if 0 + /* + * This basically doesn't work. + */ if (editScreen->isVisible()) { if (currentLeadZoneSelection.has_value()) { + bool anyActive{false}; for (const auto &v : sharedUiMemoryState.voiceDisplayItems) { - if (v.active && v.group == currentLeadZoneSelection->group && v.part == currentLeadZoneSelection->part && v.zone == currentLeadZoneSelection->zone) @@ -246,8 +250,13 @@ void SCXTEditor::idle() editScreen->updateSamplePlaybackPosition(v.sample, v.samplePos); } } + if (!anyActive) + { + editScreen->hideSamplePlaybackPosition(); + } } } +#endif headerRegion->setVULevel(sharedUiMemoryState.busVULevels[0][0], sharedUiMemoryState.busVULevels[0][1]); diff --git a/src-ui/app/editor-impl/SCXTJuceLookAndFeel.h b/src-ui/app/editor-impl/SCXTJuceLookAndFeel.h index 5431b0c5..86ed9964 100644 --- a/src-ui/app/editor-impl/SCXTJuceLookAndFeel.h +++ b/src-ui/app/editor-impl/SCXTJuceLookAndFeel.h @@ -44,6 +44,10 @@ struct SCXTJuceLookAndFeel : juce::LookAndFeel_V4 juce::Colour(0x35, 0x35, 0x45)); setColour(juce::PopupMenu::ColourIds::highlightedTextColourId, juce::Colour(0xFF, 0xFF, 0x80)); + setColour(juce::TabbedComponent::ColourIds::backgroundColourId, + juce::Colours::black.withAlpha(0.f)); + setColour(juce::TabbedComponent::ColourIds::outlineColourId, + juce::Colours::black.withAlpha(0.f)); } juce::Font getPopupMenuFont() override { return juce::Font(interMedTF).withHeight(13); }