mirror of
https://codeberg.org/armin/horizont.git
synced 2026-09-01 04:10:46 +02:00
update
This commit is contained in:
parent
ed28db30a3
commit
6c0d072465
19 changed files with 2212 additions and 0 deletions
31
Source/Knob.h
Normal file
31
Source/Knob.h
Normal 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)
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue