Skip to main content

App

Struct App 

Source
pub struct App {
Show 42 fields pub grid: Grid, pub cursor_row: u32, pub cursor_col: u32, pub mode: Mode, pub editor: Editor, pub help_open: bool, pub bpm: f64, pub playing: bool, pub beat_position: f64, pub current_play_row: Option<u32>, pub scale: Scale, pub scale_name: String, pub octave: i32, pub bridge: Bridge, pub scope_master: Vec<f32>, pub scope_graph_in: Vec<f32>, pub host_stats: HostStatsSnapshot, pub spectrum_fall_ms: f64, pub peak_l: f32, pub peak_r: f32, pub should_quit: bool, pub instrument_names: Vec<String>, pub voice_ids: Vec<u32>, pub graph_nodes: Vec<(u32, String)>, pub graph_node_descriptions: Vec<String>, pub graph_edges: Vec<Edge>, pub graph_cursor: usize, pub graph_depths: Vec<usize>, pub graph_layers: Vec<Vec<usize>>, pub graph_params: Vec<Vec<ParamDescriptor>>, pub graph_param_values: Vec<Vec<f64>>, pub graph_param_groups: Vec<Vec<ParamGroup>>, pub param_cursor: usize, pub swing: f64, pub euclidean_k: u32, pub undo_stack: Vec<Vec<Option<NoteEvent>>>, pub redo_stack: Vec<Vec<Option<NoteEvent>>>, pub bottom_pane: BottomPane, pub graph_path: Vec<u32>, pub graph_stack: Vec<GraphFrame>, pub graph_has_children: Vec<bool>, pub graph_breadcrumb: Vec<String>, /* private fields */
}
Expand description

Mutable state for the full terminal UI: pattern/graph views, audio bridge, and layout data.

Fields§

§grid: Grid§cursor_row: u32§cursor_col: u32§mode: Mode§editor: Editor§help_open: bool

Full keymap overlay (? / Esc).

§bpm: f64§playing: bool§beat_position: f64§current_play_row: Option<u32>§scale: Scale§scale_name: String§octave: i32§bridge: Bridge§scope_master: Vec<f32>

Master output (post–FX), interleaved stereo — waveform / spectrum.

§scope_graph_in: Vec<f32>

Instrument submix (pre–master bus), same layout — graph view IN preview.

§host_stats: HostStatsSnapshot

This-process CPU / RSS refreshed ~2× per second for the info panel.

§spectrum_fall_ms: f64

Peak-decay time constant for spectrum bars (ms); lower = snappier, higher = longer “tail”.

§peak_l: f32§peak_r: f32§should_quit: bool§instrument_names: Vec<String>§voice_ids: Vec<u32>§graph_nodes: Vec<(u32, String)>§graph_node_descriptions: Vec<String>§graph_edges: Vec<Edge>§graph_cursor: usize§graph_depths: Vec<usize>§graph_layers: Vec<Vec<usize>>§graph_params: Vec<Vec<ParamDescriptor>>§graph_param_values: Vec<Vec<f64>>§graph_param_groups: Vec<Vec<ParamGroup>>§param_cursor: usize§swing: f64§euclidean_k: u32§undo_stack: Vec<Vec<Option<NoteEvent>>>§redo_stack: Vec<Vec<Option<NoteEvent>>>§bottom_pane: BottomPane§graph_path: Vec<u32>

Path into nested graphs for the graph editor (empty = root).

§graph_stack: Vec<GraphFrame>

Stack of saved cursor positions when diving into nested graphs.

§graph_has_children: Vec<bool>

Tracks which nodes have inner graphs for visual indicators.

§graph_breadcrumb: Vec<String>

Breadcrumb labels for the navigation path.

Implementations§

Source§

impl App

Source

pub fn new( grid: Grid, scale: Scale, scale_name: String, bridge: Bridge, instrument_names: Vec<String>, voice_ids: Vec<u32>, ) -> Self

Initial pattern view, scale metadata, and per-column voice IDs for trem_cpal::Command::NoteOn.

Source

pub fn with_graph_info( self, nodes: Vec<(u32, String)>, edges: Vec<Edge>, params: Vec<(Vec<ParamDescriptor>, Vec<f64>, Vec<ParamGroup>)>, ) -> Self

Attaches node/edge/param snapshots for the graph editor (from the host graph).

Source

pub fn set_node_descriptions(&mut self, descriptions: Vec<String>)

Sets processor descriptions for each node (shown in info help).

Source

pub fn set_node_children(&mut self, has_children: Vec<bool>)

Marks which nodes have inner (nested) graphs for the graph view indicator.

Source

pub fn with_nested_graph_snapshots( self, snapshots: HashMap<Vec<u32>, GraphSnapshot>, ) -> Self

Supplies snapshots for nested graph levels so Graph › Enter shows nodes and parameters.

Source

pub fn sync_scope_focus(&mut self)

Tells the audio thread which signal to show in the bottom IN | OUT previews.

Source

pub fn handle_action(&mut self, action: Action)

Applies one Action from input: updates state and sends Commands to the audio bridge as needed.

Source

pub fn poll_audio(&mut self)

Drains pending Notifications and timed preview note-off; call each frame from the UI loop.

Source

pub fn draw(&mut self, frame: &mut Frame<'_>)

Lays out transport, sidebar, main view (pattern or graph), and scope into frame.

Source

pub fn run<B>(self, terminal: &mut Terminal<B>) -> Result<()>
where B: Backend, B::Error: Error + Send + Sync + 'static,

Terminal main loop until quit: render, handle keys, poll notifications.

Auto Trait Implementations§

§

impl !Freeze for App

§

impl !RefUnwindSafe for App

§

impl Send for App

§

impl !Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl !UnwindSafe for App

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,