UiComponent

Enum UiComponent 

Source
pub enum UiComponent {
Show 24 variants Group { label: String, children: Vec<UiComponent>, }, Row { children: Vec<UiComponent>, }, Column { children: Vec<UiComponent>, }, Tabs { tabs: Vec<UiTab>, }, Knob { label: String, param_id: u32, min: f32, max: f32, logarithmic: bool, }, Slider { label: String, param_id: u32, min: f32, max: f32, }, Toggle { label: String, param_id: u32, }, Dropdown { label: String, param_id: u32, options: Vec<String>, }, ButtonGroup { label: String, param_id: u32, options: Vec<String>, }, ColorPicker { label: String, r_param_id: u32, g_param_id: u32, b_param_id: u32, }, HueSlider { label: String, param_id: u32, }, XYPad { label: String, x_param_id: u32, y_param_id: u32, }, Curves { label: String, param_id: u32, }, AudioScope { label: String, source: AudioSource, }, BeatButton { label: String, trigger_id: u32, division: NoteDivision, }, ActionButton { label: String, action_id: String, }, TriggerButton { label: String, param_id: u32, }, ModulationSlot { label: String, target_param_id: u32, }, ControlPreview { label: String, port_name: String, history_length: u32, }, ControlTargetSelector { label: String, port_name: String, }, Label { text: String, }, Separator, Spacer { height: f32, }, Custom { widget_id: String, props: HashMap<String, String>, },
}
Expand description

UI Component - the AST of the UI DSL

MODs return this structure to define their UI. Host interprets and renders using egui.

Variants§

§

Group

Grouped section with label

Fields

§label: String
§children: Vec<UiComponent>
§

Row

Horizontal row of components

Fields

§children: Vec<UiComponent>
§

Column

Vertical column of components

Fields

§children: Vec<UiComponent>
§

Tabs

Tabbed sections

Fields

§tabs: Vec<UiTab>
§

Knob

Rotary knob (best for VJ performance)

Fields

§label: String
§param_id: u32
§min: f32
§max: f32
§logarithmic: bool
§

Slider

Horizontal slider

Fields

§label: String
§param_id: u32
§min: f32
§max: f32
§

Toggle

On/off toggle

Fields

§label: String
§param_id: u32
§

Dropdown

Dropdown selection

Fields

§label: String
§param_id: u32
§options: Vec<String>
§

ButtonGroup

Button group (radio button style for VJ)

Fields

§label: String
§param_id: u32
§options: Vec<String>
§

ColorPicker

Color picker (RGB) - for 3-param use cases

Fields

§label: String
§r_param_id: u32
§g_param_id: u32
§b_param_id: u32
§

HueSlider

Hue slider (single param) - for WIT ColorPicker (0.0 = red, 1.0 = red wrap)

Fields

§label: String
§param_id: u32
§

XYPad

2D XY pad controller

Fields

§label: String
§x_param_id: u32
§y_param_id: u32
§

Curves

Bezier curve editor

Fields

§label: String
§param_id: u32
§

AudioScope

Audio waveform/spectrum visualizer

Fields

§label: String
§

BeatButton

Beat-synced trigger button

Fields

§label: String
§trigger_id: u32
§division: NoteDivision
§

ActionButton

Action button (one-shot trigger via Action System)

Fields

§label: String
§action_id: String
§

TriggerButton

Trigger button - param-based one-shot (sends 1.0 for one frame, auto-resets to 0.0)

Fields

§label: String
§param_id: u32
§

ModulationSlot

Modulation source slot (for patching)

Fields

§label: String
§target_param_id: u32
§

ControlPreview

Control signal preview (waveform display for LFO, envelope, etc.)

Fields

§label: String
§port_name: String
§history_length: u32

History buffer for waveform display (values 0.0-1.0)

§

ControlTargetSelector

Control target selector for ControlOutput nodes (LFO, etc.)

Displays a dropdown to select which node/parameter this control output should modulate. The actual connection is managed by the host.

Fields

§label: String
§port_name: String

The control output port name (e.g., “output”)

§

Label

Static label text

Fields

§text: String
§

Separator

Separator line

§

Spacer

Spacer

Fields

§height: f32
§

Custom

Custom widget rendered by host

For complex widgets that can’t be expressed in DSL. Host looks up a custom renderer by widget_id.

Fields

§widget_id: String

Implementations§

Source§

impl UiComponent

Source

pub fn group(label: impl Into<String>, children: Vec<UiComponent>) -> Self

Create a group

Source

pub fn row(children: Vec<UiComponent>) -> Self

Create a row

Source

pub fn column(children: Vec<UiComponent>) -> Self

Create a column

Source

pub fn knob(label: impl Into<String>, param_id: u32, min: f32, max: f32) -> Self

Create a knob

Source

pub fn knob_log( label: impl Into<String>, param_id: u32, min: f32, max: f32, ) -> Self

Create a logarithmic knob

Source

pub fn slider( label: impl Into<String>, param_id: u32, min: f32, max: f32, ) -> Self

Create a slider

Source

pub fn toggle(label: impl Into<String>, param_id: u32) -> Self

Create a toggle

Source

pub fn dropdown( label: impl Into<String>, param_id: u32, options: Vec<String>, ) -> Self

Create a dropdown

Source

pub fn button_group( label: impl Into<String>, param_id: u32, options: Vec<String>, ) -> Self

Create a button group

Source

pub fn xy_pad( label: impl Into<String>, x_param_id: u32, y_param_id: u32, ) -> Self

Create an XY pad

Source

pub fn audio_scope(label: impl Into<String>, source: AudioSource) -> Self

Create an audio scope

Source

pub fn beat_button( label: impl Into<String>, trigger_id: u32, division: NoteDivision, ) -> Self

Create a beat button

Source

pub fn action_button( label: impl Into<String>, action_id: impl Into<String>, ) -> Self

Create an action button (one-shot trigger via Action System)

Source

pub fn trigger_button(label: impl Into<String>, param_id: u32) -> Self

Create a trigger button (param-based one-shot, auto-resets to 0.0)

Source

pub fn mod_slot(label: impl Into<String>, target_param_id: u32) -> Self

Create a modulation slot

Source

pub fn control_preview( label: impl Into<String>, port_name: impl Into<String>, history_length: u32, ) -> Self

Create a control preview (waveform display for control signals)

Source

pub fn control_target_selector( label: impl Into<String>, port_name: impl Into<String>, ) -> Self

Create a control target selector (for ControlOutput nodes like LFO)

Source

pub fn label(text: impl Into<String>) -> Self

Create a label

Source

pub fn separator() -> Self

Create a separator

Source

pub fn spacer(height: f32) -> Self

Create a spacer

Source

pub fn custom(widget_id: impl Into<String>) -> Self

Create a custom widget

Source

pub fn custom_with_props( widget_id: impl Into<String>, props: HashMap<String, String>, ) -> Self

Create a custom widget with properties

Trait Implementations§

Source§

impl Clone for UiComponent

Source§

fn clone(&self) -> UiComponent

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UiComponent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for UiComponent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for UiComponent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,