Operator SDK
Build MIDI processing and UI modes for the Operator device
Loading...
Searching...
No Matches
op::params::Action Struct Reference

A button that runs one of the mode's functions when selected. More...

#include <params.h>

Public Attributes

std::string_view name
 Display name shown as the button label.
const char * confirm = nullptr
 Optional yes/no prompt shown before the function runs.
void(* on_select )() = nullptr
 The function to run when the button is selected.
ParentRef parent = {}
 Optional Section this button nests under.

Detailed Description

A button that runs one of the mode's functions when selected.

Appears on the param page as a row labeled .name and holds no value of its own. Selecting it runs .on_select in the mode's own context, so the function reads and changes the mode's state and sends MIDI just as process() does. A .confirm holding a short question guards a destructive command, putting a yes/no prompt carrying that question first. Left unset, the function runs the moment the button is selected.

void clear_clip() { /* ... *&zwj;/ }
inline constexpr op::params::Action Clear {
    .name = "Clear Clip", .confirm = "Erase all clips?",
    .on_select = &clear_clip}; 

The documentation for this struct was generated from the following file: