feat(gui): add GUI components and displays

This commit is contained in:
2026-09-08 14:55:22 +02:00
parent 5a80534a2e
commit a9abca9e15
19 changed files with 898 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
#include "Knob.h"
namespace serum
{
Knob::Knob (const juce::String& name, std::function<juce::String (float)> fmt)
: formatter (std::move (fmt))
{
setSliderStyle (juce::Slider::RotaryVerticalDrag);
setTextBoxStyle (juce::Slider::NoTextBox, false, 0, 0);
setRange (0.0, 1.0);
setDoubleClickReturnValue (true, 0.5);
setName (name);
setComponentID (name);
}
juce::String Knob::getTextFromValue (double value)
{
if (formatter)
return formatter ((float) value);
return formatPercent ((float) value);
}
} // namespace serum