mirror of
https://codeberg.org/armin/ambivalence.git
synced 2026-09-01 12:20: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
|
|
@ -6,31 +6,33 @@
|
|||
#include "GUI/AmbivalenceUI.h"
|
||||
#include "GUI/DecayCurveViz.h"
|
||||
|
||||
class FDNReverbEditor : public juce::AudioProcessorEditor,
|
||||
private juce::Timer
|
||||
// -----------------------------------------------------------------------------
|
||||
// EditorContent
|
||||
// -----------------------------------------------------------------------------
|
||||
// Holds every UI element of the editor and is the only component that gets a
|
||||
// zoom transform applied. The top-level AudioProcessorEditor stays
|
||||
// untransformed and is sized to exactly fit the transformed content, so the
|
||||
// host always sees a window that matches what the plugin draws (no double
|
||||
// scaling, no clipped / blank margins at any zoom level).
|
||||
// -----------------------------------------------------------------------------
|
||||
class EditorContent : public juce::Component
|
||||
{
|
||||
public:
|
||||
explicit FDNReverbEditor(FDNReverbAudioProcessor&);
|
||||
~FDNReverbEditor() override;
|
||||
explicit EditorContent(FDNReverbAudioProcessor& p, AmbivalenceLookAndFeel& laf);
|
||||
|
||||
void paint(juce::Graphics&) override;
|
||||
void resized() override;
|
||||
|
||||
private:
|
||||
void timerCallback() override;
|
||||
void updatePanelVisibility();
|
||||
void setProMode(bool pro);
|
||||
|
||||
// --- Preset UI helpers ---
|
||||
void refreshPresetCombo();
|
||||
void savePresetWithDialog();
|
||||
void deleteCurrentPreset();
|
||||
|
||||
FDNReverbAudioProcessor& audioProcessor;
|
||||
AmbivalenceLookAndFeel laf;
|
||||
// --- zoom ---
|
||||
static constexpr float kDefaultZoom = 1.5f;
|
||||
float currentZoom{ kDefaultZoom };
|
||||
float uiScale{ 1.0f }; // derived from getWidth()/W, applied to every child bounds
|
||||
std::function<void(float)> onZoomChange;
|
||||
AmbivalenceLookAndFeel* lookAndFeel{ nullptr };
|
||||
|
||||
// --- common ---
|
||||
AlgorithmSelector algoSelector;
|
||||
RT60Visualizer rt60Viz;
|
||||
DecayCurveViz decayCurveViz;
|
||||
VUMeter vuIn, vuOut;
|
||||
juce::Label titleLabel;
|
||||
|
|
@ -43,12 +45,13 @@ private:
|
|||
|
||||
juce::Label statusLabel;
|
||||
|
||||
juce::TextButton zoomButton;
|
||||
juce::TextButton proModeButton;
|
||||
juce::TextButton erSoloButton;
|
||||
std::unique_ptr<juce::AudioProcessorValueTreeState::ButtonAttachment> proModeAttachment;
|
||||
std::unique_ptr<juce::AudioProcessorValueTreeState::ButtonAttachment> erSoloAttachment;
|
||||
|
||||
bool isProMode{ false };
|
||||
bool proMode{ false };
|
||||
|
||||
// --- Normal Mode ---
|
||||
ArcKnob kPreDelay, kRoomSize, kDecay;
|
||||
|
|
@ -69,18 +72,16 @@ private:
|
|||
ArcKnob kLoCutPro, kHiCutPro;
|
||||
|
||||
// --- preset UI ---
|
||||
std::unique_ptr<PresetManager> presetManager;
|
||||
juce::TextButton presetPrevButton;
|
||||
juce::ComboBox presetCombo;
|
||||
juce::TextButton presetNextButton;
|
||||
// existing presetSaveButton / presetDeleteButton next to added
|
||||
juce::TextButton presetSaveButton;
|
||||
juce::TextButton presetLoadButton; // * added
|
||||
juce::TextButton presetLoadButton;
|
||||
juce::TextButton presetDeleteButton;
|
||||
|
||||
// --- layout constants ---
|
||||
static constexpr int W = 900;
|
||||
static constexpr int H = 540;
|
||||
static constexpr int H = 450;
|
||||
static constexpr int PAD = 8;
|
||||
static constexpr int KNOB_W = 64;
|
||||
static constexpr int KNOB_H = 72;
|
||||
|
|
@ -93,5 +94,38 @@ private:
|
|||
// DUCKING end (616) + gap(16) = 632
|
||||
static constexpr int PRESET_PANEL_X = 632;
|
||||
|
||||
void updatePanelVisibility();
|
||||
void showZoomMenu();
|
||||
void setZoomLevel(float scale);
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(EditorContent)
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Editor
|
||||
// -----------------------------------------------------------------------------
|
||||
class FDNReverbEditor : public juce::AudioProcessorEditor,
|
||||
private juce::Timer
|
||||
{
|
||||
public:
|
||||
explicit FDNReverbEditor(FDNReverbAudioProcessor&);
|
||||
~FDNReverbEditor() override;
|
||||
|
||||
void paint(juce::Graphics&) override;
|
||||
void resized() override;
|
||||
|
||||
private:
|
||||
void timerCallback() override;
|
||||
|
||||
// --- Preset UI helpers ---
|
||||
void refreshPresetCombo();
|
||||
void savePresetWithDialog();
|
||||
void deleteCurrentPreset();
|
||||
|
||||
FDNReverbAudioProcessor& audioProcessor;
|
||||
AmbivalenceLookAndFeel laf;
|
||||
std::unique_ptr<EditorContent> content;
|
||||
std::unique_ptr<PresetManager> presetManager;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FDNReverbEditor)
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue