Menu System
Pre-built menu UI components
The menu system provides a complete solution for building settings screens and navigation hierarchies.
Menu Entry Types
- Custom - Action triggered on selection
- Submenu - Navigate to nested menu
- Param - Edit a parameter value
Basic Example
static void settings_menu(ui_menu_t* menu) {
ui_menu_add_custom(menu, "Reset", NULL, reset_action, NULL);
}
static void root_menu(ui_menu_t* menu) {
ui_menu_add_custom(menu, "Play", NULL, play_action, NULL);
ui_menu_add_submenu(menu, "Settings", NULL, settings_menu, NULL);
}
// In init
ui_menu_t* menu = ui_menu_init(app, root_menu);One button's hint labels. NULL or "" leaves that action blank.
| const char* | press | |
| const char* | hold |
Install this app's button hints into the system hint band.
| const tapp_hint_pair_t* | labels | array of 5, in physical button order BTN1..BTN5 |
| HintsActionsTotal | 0 |
Highlith a hint cell (solid plate, inverted text) Use it for any on/off mode your button toggles.
| HintActionType | action | |
| bool | active |
Flash a hint cell the way the device flashes its own — solid plate the instant you call it, 2px depress, fading out on its own after ~240ms. Use it for MOMENTARY actions (a shuffle, a retrigger) that have no on/off state.
| HintActionType | action |
Dim a hint cell as UNAVAILABLE (dithered knockout, outline intact) — how the device greys out actions that don't apply, e.g. cut/copy while the deck is playing. Purely visual for a tapp: your on_input still decides.
| HintActionType | action | |
| bool | locked |
Put your app's text in the system statusbar (left side)
| const char* | text | string to show; NULL or "" removes the item |
Put your app's own GRAPHICS in the system statusbar (left side)
| tapp_statusbar_gfx_cb | cb | Draw callback, or NULL to remove the item |
| uint16_t | width | Cell width in pixels |
| void* | user | Context handed back to cb |
Put an icon INSIDE a hint cell (left of the re-centred label)
| HintActionType | action | Which cell (HintPress1..HintHold5) |
| const gfx_img_t* | icon | Your compiled asset, or NULL to clear |
Draw a hint cell's content YOURSELF (procedural graphics in the cell)
| HintActionType | action | Which cell (HintPress1..HintHold5) |
| tapp_statusbar_gfx_cb | cb | Draw callback (same shape as the statusbar one), or NULL to restore the label |
| void* | user | Context handed back to cb |
Mechanical rolling-TEXT state — split-flap style label animation.
| char[UI_ROLL_TEXT_MAX] | from | |
| char[UI_ROLL_TEXT_MAX] | tgt | |
| float[UI_ROLL_TEXT_MAX] | phase | |
| uint8_t | len | |
| uint8_t | inited |
Draw a rolling label, right edge at x_right, baseline at y
| gfx_t* | gfx | |
| uint16_t | x_right | |
| uint16_t | y | |
| ui_roll_text_t* | c | |
| const char* | value |
Returns — true while any character is still rolling
| ui_roll_text_t* | c | |
| const char* | value |
Raise or drop the hint band installed by ui_hints_set_labels()
| bool | stat | true to show hints, false to hide |
Install one VOLUME cell in the hint band — the same cells the device's own hold-PLAY volume band is made of (icon + name + live VU + cursor, active cell enlarged with the same animation).
| uint8_t | slot | Physical button, 1..5 |
| uint8_t | row | 0 = press row, 1 = hold row |
| const char* | name | Cell label — REFERENCED, must outlive the app state showing it |
| params_t* | param | The params_t this cell displays and whose ->val you adjust (typically from the encoder in on_input). NULL clears the cell — unless `name` is non-empty, which installs a plain LABEL cell instead (e.g. "<" / ">" nav arrows on the buttons that switch your selection, the same affordance the device's band has). Use ParamValDBType for gain-style 0..2.0 params — the linear draw branch assumes 0..1. |
| uint8_t | icon_id | Icon AND VU source: 0 = output (volume icon, output bus), 1 = input (jack/mic icon following the live source, input bus), 2 = fx |
Enlarge/activate one volume cell (slot 0 = none). The cells animate exactly like the device's own band; call this when your selection moves.
| uint8_t | slot | |
| uint8_t | row |
Show or hide the whole system statusbar (battery, status items, hints)
| bool | state | true to show, false to hide |