Skip to content

Commit

Permalink
More sample tweaks around outlines, sample position, etc (#1239)
Browse files Browse the repository at this point in the history
Basically getting quite close now on part of the screen
  • Loading branch information
baconpaul authored Sep 1, 2024
1 parent a09629a commit f8977d6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -207,7 +207,6 @@ void SampleWaveform::rebuildEnvelopePaths()
jassertfalse;
}

bool first{true};
upperFill[ch] = juce::Path();
upperStroke[ch] = juce::Path();
lowerFill[ch] = juce::Path();
Expand All @@ -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);
Expand All @@ -247,6 +248,7 @@ void SampleWaveform::rebuildEnvelopePaths()
}
}

first = true;
for (const auto &[smp, val] : bottomLine)
{
auto pos = xPixelForSample(smp);
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
11 changes: 10 additions & 1 deletion src-ui/app/editor-impl/SCXTEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,31 @@ 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)
{
editScreen->updateSamplePlaybackPosition(v.sample, v.samplePos);
}
}
if (!anyActive)
{
editScreen->hideSamplePlaybackPosition();
}
}
}
#endif

headerRegion->setVULevel(sharedUiMemoryState.busVULevels[0][0],
sharedUiMemoryState.busVULevels[0][1]);
Expand Down
4 changes: 4 additions & 0 deletions src-ui/app/editor-impl/SCXTJuceLookAndFeel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down

0 comments on commit f8977d6

Please sign in to comment.