Update readme, add potentiometer controls
This commit is contained in:
24
src/main.cpp
24
src/main.cpp
@@ -106,6 +106,10 @@ struct AppState {
|
||||
// Corner radius selection
|
||||
S32 radius_sel;
|
||||
|
||||
// Knob demo state
|
||||
F32 demo_knob_unsigned;
|
||||
F32 demo_knob_signed;
|
||||
|
||||
// Audio device selection
|
||||
S32 audio_device_sel; // dropdown index: 0 = None, 1+ = device
|
||||
S32 audio_device_prev; // previous selection for change detection
|
||||
@@ -278,6 +282,24 @@ static void build_main_panel(AppState *app) {
|
||||
.backgroundColor = g_theme.border
|
||||
) {}
|
||||
|
||||
// Section: Knobs
|
||||
ui_label("LblKnobs", "Knobs");
|
||||
CLAY(CLAY_ID("KnobRow"),
|
||||
.layout = {
|
||||
.sizing = { .width = CLAY_SIZING_FIT(), .height = CLAY_SIZING_FIT() },
|
||||
.childGap = uip(16),
|
||||
.layoutDirection = CLAY_LEFT_TO_RIGHT,
|
||||
}
|
||||
) {
|
||||
ui_knob("KnobVolume", "Volume", &app->demo_knob_unsigned, 100.0f, 0, 75.0f, 1);
|
||||
ui_knob("KnobPan", "Pan", &app->demo_knob_signed, 50.0f, 1, 0.0f, 1);
|
||||
}
|
||||
|
||||
CLAY(CLAY_ID("Sep6"),
|
||||
.layout = { .sizing = { .width = CLAY_SIZING_GROW(), .height = CLAY_SIZING_FIXED(1) } },
|
||||
.backgroundColor = g_theme.border
|
||||
) {}
|
||||
|
||||
// Section: Windows & Modals
|
||||
ui_label("LblWindows", "Windows & Modals");
|
||||
CLAY(CLAY_ID("WindowBtnRow"),
|
||||
@@ -876,6 +898,8 @@ int main(int argc, char **argv) {
|
||||
app.show_props = 1;
|
||||
app.show_log = 1;
|
||||
app.show_midi_devices = 1;
|
||||
app.demo_knob_unsigned = 75.0f;
|
||||
app.demo_knob_signed = 0.0f;
|
||||
app.demo_dropdown_sel = 1; // default to 48000 Hz
|
||||
app.radius_sel = 1; // default to "Small" (4.0f)
|
||||
snprintf(app.demo_text_a, sizeof(app.demo_text_a), "My Instrument");
|
||||
|
||||
Reference in New Issue
Block a user