mirror of
https://codeberg.org/armin/justasample.git
synced 2026-09-01 04:10:48 +02:00
fixes, changes to gitignore
This commit is contained in:
parent
2ab046489f
commit
11d81cf1fd
17 changed files with 1160 additions and 16 deletions
|
|
@ -80,6 +80,8 @@ JustaSampleAudioProcessorEditor::JustaSampleAudioProcessorEditor(JustaSampleAudi
|
|||
[this](const juce::MouseWheelDetails& details, int center) -> void { sampleNavigator.scrollView(details, center, true); }),
|
||||
sampleNavigator(p.APVTS(), p.getPluginState(), synthVoices),
|
||||
|
||||
modulationSection(p),
|
||||
|
||||
fxChain(p),
|
||||
|
||||
// Footer
|
||||
|
|
@ -282,6 +284,9 @@ JustaSampleAudioProcessorEditor::JustaSampleAudioProcessorEditor(JustaSampleAudi
|
|||
// FX
|
||||
addChildComponent(fxChain);
|
||||
|
||||
// Modulation section
|
||||
addAndMakeVisible(modulationSection);
|
||||
|
||||
// Footer
|
||||
preFXButton.useShape(getOutlineFromSVG(BinaryData::IconPreFX_svg));
|
||||
preFXButton.setHelpText("Apply FX before Attack/Release");
|
||||
|
|
@ -421,8 +426,6 @@ void JustaSampleAudioProcessorEditor::timerCallback()
|
|||
|
||||
void JustaSampleAudioProcessorEditor::paint(juce::Graphics& g)
|
||||
{
|
||||
auto colors = getTheme();
|
||||
|
||||
g.fillAll(theme.light);
|
||||
|
||||
auto bounds = getConstrainedBounds().toFloat();
|
||||
|
|
@ -467,6 +470,8 @@ void JustaSampleAudioProcessorEditor::paint(juce::Graphics& g)
|
|||
|
||||
if (sampleLoaded || pluginState.showFX)
|
||||
{
|
||||
bounds.removeFromBottom(scalei(Layout::modulationSectionHeight));
|
||||
|
||||
auto navigatorBounds = bounds.removeFromBottom(scalei(Layout::sampleNavigatorHeight));
|
||||
g.setColour(theme.foreground);
|
||||
g.fillRect(navigatorBounds.toNearestInt());
|
||||
|
|
@ -730,9 +735,17 @@ void JustaSampleAudioProcessorEditor::resized()
|
|||
}
|
||||
fxChain.setVisible(pluginState.showFX);
|
||||
|
||||
// Navigator
|
||||
// Modulation section (always visible when sample loaded)
|
||||
auto sampleLoaded = bool(p.getSampleBuffer().getNumSamples());
|
||||
if (sampleLoaded || pluginState.showFX)
|
||||
{
|
||||
auto modBounds = bounds.removeFromBottom(scalei(Layout::modulationSectionHeight));
|
||||
modulationSection.setBounds(modBounds.toNearestInt());
|
||||
}
|
||||
modulationSection.setVisible(sampleLoaded || pluginState.showFX);
|
||||
|
||||
// Navigator
|
||||
if (sampleLoaded || pluginState.showFX)
|
||||
{
|
||||
auto sampleNavigatorBounds = bounds.removeFromBottom(scalei(Layout::sampleNavigatorHeight));
|
||||
sampleNavigator.setBounds(sampleNavigatorBounds.toNearestInt());
|
||||
|
|
@ -834,7 +847,7 @@ void JustaSampleAudioProcessorEditor::lookAndFeelChanged()
|
|||
juce::Array<Component*> foregroundComponents = {
|
||||
&tuningLabel, &attackLabel, &releaseLabel, &playbackLabel, &loopingLabel, &masterLabel, &semitoneRotary, &waveformSemitoneRotary, ¢Rotary, &waveformCentRotary, &tuningDetectLabel, &tuningDetectButton,
|
||||
&attackTimeRotary, &attackCurve, &releaseTimeRotary, &releaseCurve, &lofiModeButton, &playbackModeButton, &playbackSpeedRotary, &loopStartButton, &loopButton, &loopEndButton, &pingPongButton, &crossfadeRotary,
|
||||
&monoOutputButton, &gainSlider, &filenameComponent, &linkSampleToggle, &playStopButton, &recordButton, &deviceSettingsButton, &fitButton, &pinButton, &sampleNavigator, &preFXButton, &showFXButton
|
||||
&monoOutputButton, &gainSlider, &filenameComponent, &linkSampleToggle, &playStopButton, &recordButton, &deviceSettingsButton, &fitButton, &pinButton, &sampleNavigator, &modulationSection, &preFXButton, &showFXButton
|
||||
};
|
||||
|
||||
for (Component* component : foregroundComponents)
|
||||
|
|
@ -891,12 +904,13 @@ Colors JustaSampleAudioProcessorEditor::getTheme() const
|
|||
juce::Rectangle<int> JustaSampleAudioProcessorEditor::getConstrainedBounds() const
|
||||
{
|
||||
auto fxSpace = !pluginState.showFX ? scalef(Layout::fxChainHeight) : 0;
|
||||
auto modSpace = scalef(Layout::modulationSectionHeight);
|
||||
|
||||
auto bounds = getLocalBounds();
|
||||
auto width = getWidth();
|
||||
auto height = getHeight();
|
||||
auto constrainedWidth = int(juce::jlimit<float>((height + fxSpace) * 0.8f, (height + fxSpace) * 2.f, float(width)));
|
||||
auto constrainedHeight = int(width / 0.8f - fxSpace);
|
||||
auto constrainedWidth = int(juce::jlimit<float>((height + fxSpace + modSpace) * 0.8f, (height + fxSpace + modSpace) * 2.f, float(width)));
|
||||
auto constrainedHeight = int(width / 0.8f - fxSpace - modSpace);
|
||||
|
||||
if (constrainedWidth < width)
|
||||
bounds.reduce((width - constrainedWidth) / 2, 0);
|
||||
|
|
@ -1067,7 +1081,7 @@ void JustaSampleAudioProcessorEditor::enablementChanged()
|
|||
juce::Array<Component*> sampleDependentComponents = {
|
||||
&semitoneRotary, ¢Rotary, &waveformSemitoneRotary, &waveformCentRotary, &tuningDetectLabel, &tuningDetectButton,
|
||||
&attackTimeRotary, &attackCurve, &releaseTimeRotary, &releaseCurve, &gainSlider,
|
||||
&playStopButton, &fitButton, &pinButton, &sampleEditor, &sampleNavigator, &fxChain, &showFXButton
|
||||
&playStopButton, &fitButton, &pinButton, &sampleEditor, &sampleNavigator, &modulationSection, &fxChain, &showFXButton
|
||||
};
|
||||
|
||||
juce::Array<Component*> notWaveformModeComponents = { &playbackModeButton, &loopStartButton, &loopButton, &loopEndButton, &pingPongButton, &crossfadeRotary, &tuningDetectLabel, &tuningDetectButton };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue