mirror of
https://codeberg.org/armin/gelyk.git
synced 2026-10-11 17:01:53 +02:00
Initial Gelyk EQ plugin
This commit is contained in:
commit
13863f4522
9 changed files with 1080 additions and 0 deletions
83
Source/PluginEditor.h
Normal file
83
Source/PluginEditor.h
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
#pragma once
|
||||
|
||||
#include <JuceHeader.h>
|
||||
#include "PluginProcessor.h"
|
||||
|
||||
namespace gelyk
|
||||
{
|
||||
|
||||
class NeonLookAndFeel : public juce::LookAndFeel_V4
|
||||
{
|
||||
public:
|
||||
NeonLookAndFeel();
|
||||
void drawLinearSlider(juce::Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const juce::Slider::SliderStyle, juce::Slider&) override;
|
||||
void drawComboBox(juce::Graphics&, int width, int height, bool isButtonDown,
|
||||
int buttonX, int buttonY, int buttonW, int buttonH,
|
||||
juce::ComboBox&) override;
|
||||
void positionComboBoxText(juce::ComboBox&, juce::Label&) override;
|
||||
|
||||
juce::Colour cyan { 0xff00e5ff };
|
||||
juce::Colour magenta{ 0xffff2fd6 };
|
||||
juce::Colour violet { 0xff8a2be2 };
|
||||
juce::Colour bg { 0xff0b0f16 };
|
||||
juce::Colour panel { 0xff121a24 };
|
||||
juce::Colour line { 0xff1f2a38 };
|
||||
juce::Colour textDim{ 0xff7a8aa0 };
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class GelykEQAudioProcessorEditor final : public juce::AudioProcessorEditor,
|
||||
public juce::Timer
|
||||
{
|
||||
public:
|
||||
explicit GelykEQAudioProcessorEditor(GelykEQAudioProcessor&);
|
||||
~GelykEQAudioProcessorEditor() override;
|
||||
|
||||
void paint(juce::Graphics&) override;
|
||||
void resized() override;
|
||||
void timerCallback() override;
|
||||
|
||||
private:
|
||||
void rebuildFaders();
|
||||
void scaleUI(float percent);
|
||||
|
||||
GelykEQAudioProcessor& processor;
|
||||
|
||||
NeonLookAndFeel lookAndFeel;
|
||||
|
||||
static constexpr int numBands = 5;
|
||||
struct BandWidget
|
||||
{
|
||||
std::unique_ptr<juce::Slider> gain;
|
||||
std::unique_ptr<juce::Slider> q;
|
||||
std::unique_ptr<juce::Label> freqLabel;
|
||||
std::unique_ptr<juce::Label> gainLabel;
|
||||
};
|
||||
BandWidget bands[numBands];
|
||||
|
||||
std::unique_ptr<juce::Label> masterLabel;
|
||||
std::unique_ptr<juce::Slider> master;
|
||||
|
||||
std::unique_ptr<juce::ComboBox> scaleBox;
|
||||
std::unique_ptr<juce::Label> titleLabel;
|
||||
|
||||
std::unique_ptr<juce::Label> statusBar;
|
||||
std::unique_ptr<juce::Label> statusGit;
|
||||
|
||||
juce::AudioProcessorValueTreeState::SliderAttachment gainAttachments[numBands];
|
||||
juce::AudioProcessorValueTreeState::SliderAttachment qAttachments[numBands];
|
||||
std::unique_ptr<juce::AudioProcessorValueTreeState::SliderAttachment> masterAttachment;
|
||||
|
||||
juce::AudioProcessorValueTreeState::ParameterAttachment analyserAttachment;
|
||||
|
||||
juce::Array<float> spectrum;
|
||||
juce::Array<float> freqBins;
|
||||
std::atomic<float> scaling { 1.0f }; // for resized()
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(GelykEQAudioProcessorEditor)
|
||||
};
|
||||
|
||||
} // namespace gelyk
|
||||
Loading…
Add table
Add a link
Reference in a new issue