mirror of
https://codeberg.org/armin/ambivalence.git
synced 2026-09-01 04:10:48 +02:00
UI changes, layout redefinition
This commit is contained in:
parent
42cf8432bf
commit
1d9ba772fe
12 changed files with 536 additions and 528 deletions
|
|
@ -1,22 +1,21 @@
|
|||
#pragma once
|
||||
#include <JuceHeader.h>
|
||||
#include "../AlgorithmPresets.h"
|
||||
|
||||
class FDNReverbAudioProcessor;
|
||||
|
||||
// --- Ambivalence Design System ------------------------------------------
|
||||
namespace AmbivalenceColors {
|
||||
const juce::Colour Background{ 0xFF1A1A1A };
|
||||
const juce::Colour Surface{ 0xFF242424 };
|
||||
const juce::Colour Panel{ 0xFF2C2C2C };
|
||||
const juce::Colour Border{ 0xFF3C3C3C };
|
||||
const juce::Colour Accent{ 0xFFFF6B00 };
|
||||
const juce::Colour AccentBlue{ 0xFF4090FF };
|
||||
const juce::Colour TextPrimary{ 0xFFE8E8E8 };
|
||||
const juce::Colour TextSecondary{ 0xFF888888 };
|
||||
const juce::Colour ArcTrack{ 0xFF3A3A3A };
|
||||
const juce::Colour ArcFill{ 0xFFFF6B00 };
|
||||
const juce::Colour Separator{ 0xFF383838 };
|
||||
const juce::Colour Background{ 0xFF181819 }; // palette 0
|
||||
const juce::Colour Surface{ 0xFF2C2E34 }; // theme background
|
||||
const juce::Colour Panel{ 0xFF2C2E34 }; // theme background
|
||||
const juce::Colour Border{ 0xFF3B3E48 }; // selection background
|
||||
const juce::Colour Accent{ 0xFFF39660 }; // palette 6/14
|
||||
const juce::Colour AccentBlue{ 0xFF76CCE0 }; // palette 4/12
|
||||
const juce::Colour TextPrimary{ 0xFFE2E2E3 }; // foreground
|
||||
const juce::Colour TextSecondary{ 0xFF7F8490 }; // palette 8
|
||||
const juce::Colour ArcTrack{ 0xFF3B3E48 }; // selection background
|
||||
const juce::Colour ArcFill{ 0xFF76CCE0 }; // plain blue arc
|
||||
const juce::Colour Separator{ 0xFF2C2E34 }; // theme background
|
||||
}
|
||||
|
||||
// --- Ambivalence LookAndFeel --------------------------------------------
|
||||
|
|
@ -38,32 +37,12 @@ public:
|
|||
void drawGroupComponentOutline(juce::Graphics&, int w, int h,
|
||||
const juce::String&, const juce::Justification&,
|
||||
juce::GroupComponent&) override;
|
||||
|
||||
float zoomScale{ 1.0f }; // pushed by the editor so fonts scale with zoom
|
||||
private:
|
||||
juce::Font mainFont;
|
||||
};
|
||||
|
||||
// --- RT60 Visualizer -------------------------------------------------
|
||||
class RT60Visualizer : public juce::Component, private juce::Timer
|
||||
{
|
||||
public:
|
||||
RT60Visualizer();
|
||||
~RT60Visualizer() override;
|
||||
void setProcessor(FDNReverbAudioProcessor* p) { processor = p; }
|
||||
void paint(juce::Graphics&) override;
|
||||
private:
|
||||
void timerCallback() override;
|
||||
FDNReverbAudioProcessor* processor{ nullptr };
|
||||
std::array<float, FDNReverb::NUM_BANDS> displayRT60;
|
||||
|
||||
static constexpr float MIN_RT60_DISPLAY = 0.05f;
|
||||
static constexpr float MAX_RT60_DISPLAY_FLOOR = 4.0f; // Y axis above value
|
||||
|
||||
// * dynamic Y axis above : effectiveRT60 maximum value smoothly
|
||||
float dynamicMaxRT60{ MAX_RT60_DISPLAY_FLOOR };
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(RT60Visualizer)
|
||||
};
|
||||
|
||||
// --- VU Meter --------------------------------------------------------
|
||||
class VUMeter : public juce::Component
|
||||
{
|
||||
|
|
@ -72,10 +51,12 @@ public:
|
|||
VUMeter(const juce::String& label, Side side);
|
||||
void paint(juce::Graphics&) override;
|
||||
void setLevels(float l, float r) noexcept { levelL = l; levelR = r; }
|
||||
void setZoomScale(float s) noexcept { zoomScale = s; repaint(); }
|
||||
private:
|
||||
juce::String label;
|
||||
Side side;
|
||||
float levelL{ 0.f }, levelR{ 0.f };
|
||||
float zoomScale{ 1.0f };
|
||||
};
|
||||
|
||||
// --- Labelled Arc Knob -----------------------------------------------
|
||||
|
|
@ -89,22 +70,4 @@ struct ArcKnob {
|
|||
const juce::String& labelText,
|
||||
juce::Component* parent,
|
||||
AmbivalenceLookAndFeel& laf);
|
||||
};
|
||||
|
||||
// --- Algorithm Selector ----------------------------------------------
|
||||
class AlgorithmSelector : public juce::Component,
|
||||
private juce::AudioProcessorValueTreeState::Listener
|
||||
{
|
||||
public:
|
||||
AlgorithmSelector(juce::AudioProcessorValueTreeState& apvts);
|
||||
~AlgorithmSelector() override;
|
||||
void paint(juce::Graphics&) override;
|
||||
void resized() override;
|
||||
private:
|
||||
void parameterChanged(const juce::String&, float) override;
|
||||
void updateButtonColors();
|
||||
std::array<juce::TextButton, FDNReverb::NUM_ALGORITHMS> buttons;
|
||||
juce::AudioProcessorValueTreeState& apvts;
|
||||
int currentAlgo{ 0 };
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AlgorithmSelector)
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue