This commit is contained in:
Armin 2026-08-10 12:55:02 +02:00
commit 6c0d072465
19 changed files with 2212 additions and 0 deletions

31
Source/Knob.h Normal file
View file

@ -0,0 +1,31 @@
#pragma once
#include <JuceHeader.h>
class Knob : public juce::Component
{
public:
Knob (const juce::String& title,
juce::AudioProcessorValueTreeState& apvts,
const juce::String& paramID,
float defaultValue,
std::function<juce::String (float)> format,
const juce::String& tooltip);
void paint (juce::Graphics&) override;
void resized() override;
void setScaleFactor (float scale);
private:
void updateValueLabel();
std::function<juce::String (float)> format;
juce::Label nameLabel;
juce::Label valueLabel;
juce::Slider slider;
std::unique_ptr<juce::AudioProcessorValueTreeState::SliderAttachment> attachment;
float scaleFactor = 1.0f;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Knob)
};