Skip to main content

NavState

Struct NavState 

Source
pub struct NavState {
Show 20 fields pub focused_pane: Pane, pub track_cursor: usize, pub track_scroll: usize, pub track_selected: bool, pub track_element: TrackElement, pub number_buf: NumberBuffer, pub space_menu: SpaceMenu, pub clip_view: ClipViewState, pub clip_view_visible: bool, pub clip_view_target: Option<(usize, usize)>, pub fx_menu: FxMenu, pub instrument_modal: InstrumentModal, pub loop_editor: LoopEditor, pub transport_ui: TransportUiState, pub tracks: Vec<TrackState>, pub input_modal: InputModal, pub confirm_modal: ConfirmModal, pub undo_stack: UndoStack, pub clip_locked: bool, pub recording_grace: usize,
}

Fields§

§focused_pane: Pane§track_cursor: usize§track_scroll: usize§track_selected: bool§track_element: TrackElement§number_buf: NumberBuffer§space_menu: SpaceMenu§clip_view: ClipViewState§clip_view_visible: bool§clip_view_target: Option<(usize, usize)>

(track_idx, clip_idx) shown in clip view.

§fx_menu: FxMenu

FX menu state (per-track fx button).

§instrument_modal: InstrumentModal§loop_editor: LoopEditor§transport_ui: TransportUiState§tracks: Vec<TrackState>§input_modal: InputModal

Text input modal (for save/open file paths).

§confirm_modal: ConfirmModal

Confirmation modal (for delete actions).

§undo_stack: UndoStack

Undo/redo stack.

§clip_locked: bool

Whether a clip is “locked” for editing (Enter locks, Esc unlocks). When locked, h/l moves the clip instead of navigating between elements.

§recording_grace: usize

Grace counter: set to the number of armed tracks when recording stops. Decremented as each valid snapshot is accepted. Prevents stale snapshots while allowing final recording commits from all tracks to come through.

Implementations§

Source§

impl NavState

Source

pub fn toggle_space_menu(&mut self)

Toggle the space menu open/closed.

Source

pub fn space_menu_handle(&mut self, ch: char) -> Option<SpaceAction>

Handle a key press while the space menu is open. Returns a SpaceAction if an action should be performed. Handle a key press while the space menu is open. Returns a SpaceAction if an action should be performed.

Source

pub fn focus_pane(&mut self, pane: Pane)

Source

pub fn focus_next_pane(&mut self)

Source

pub fn move_up(&mut self)

Source

pub fn move_down(&mut self)

Source

pub fn move_left(&mut self)

Source

pub fn move_right(&mut self)

Source

pub fn adjust_setting(&mut self, direction: i32)

Adjust the currently selected setting in the Settings tab.

Source

pub fn enter(&mut self) -> Option<SpaceAction>

Adjust the currently selected synth parameter by delta. Returns the (mixer_id, param_index, new_value) if changed, for sending to audio.

Source

pub fn escape(&mut self)

Source

pub fn cycle_tab(&mut self)

Cycle tabs in the clip view (FX panel or piano roll side). Cycle through ALL tabs in buffer 3: trk fx → synth → inst config → piano → auto → trk fx… Cycle tabs in the clip view (FX panel or piano roll side). Cycle through ALL tabs in buffer 3: trk fx → synth → inst config → piano → auto → trk fx…

Source§

impl NavState

Source

pub fn adjust_synth_param(&mut self, delta: f32) -> Option<(usize, usize, f32)>

Adjust the currently selected synth parameter by delta. Returns the (mixer_id, param_index, new_value) if changed, for sending to audio.

Source

pub fn show_current_track_controls(&mut self)

Show controls for the currently selected track and route MIDI to it. For instrument tracks: opens clip view with Synth tab, activates MIDI input. For bus tracks: no clip view, deactivates MIDI.

Source§

impl NavState

Source

pub fn toggle_mute(&mut self)

Source

pub fn toggle_solo(&mut self)

Source

pub fn toggle_arm(&mut self)

Source

pub fn digit_input(&mut self, ch: char)

Source

pub fn tick(&mut self)

Source

pub fn jump_to_clip(&mut self, clip_number: usize)

Source

pub fn activate_element(&mut self)

Source

pub fn add_instrument_track( &mut self, instrument: InstrumentType, mixer_id: usize, handle: Arc<TrackHandle>, )

Add a new instrument track. Inserts before the send/master tracks. handle is the shared audio-thread handle for this track. mixer_id is the track’s ID in the mixer. Add a new instrument track. Inserts before the send/master tracks. handle is the shared audio-thread handle for this track. mixer_id is the track’s ID in the mixer.

Source

pub fn open_clip_view(&mut self, track_idx: usize, clip_idx: usize)

Source

pub fn fx_menu_select(&mut self)

Show controls for the currently selected track and route MIDI to it. For instrument tracks: opens clip view with Synth tab, activates MIDI input. For bus tracks: no clip view, deactivates MIDI.

Source

pub fn active_fx_chain_len(&self) -> usize

Source

pub fn sync_clip_view_target(&mut self)

Keep clip_view_target in sync with the currently selected clip element. Called every frame as a safety net and after clip-modifying operations.

Source

pub fn dedup_clips(&mut self) -> Vec<(usize, usize)>

Remove phantom clips: when two clips overlap at the same start position, keep the longer one and absorb the shorter one’s notes (rescaled). Returns (mixer_id, removed_clip_index) pairs so the caller can sync audio.

Source

pub fn receive_clip_snapshot( &mut self, snap: ClipSnapshot, is_recording: bool, ) -> Option<(usize, usize)>

Receive a clip snapshot from the audio thread and add it to the corresponding TUI track’s clip list. is_recording = true when transport is actively recording (snapshots are fresh overdubs). When NOT recording, snapshots matching the viewed clip are stale (from panic/reset) and ignored. Returns (mixer_id, count_absorbed) so caller can send RemoveClip commands to audio.

Source§

impl NavState

Source

pub fn new(tracks: Vec<TrackState>) -> Self

Source

pub fn visible_tracks(&self) -> &[TrackState]

Source

pub fn can_scroll_up(&self) -> bool

Source

pub fn can_scroll_down(&self) -> bool

Source

pub fn current_track(&self) -> Option<&TrackState>

Source

pub fn current_track_mut(&mut self) -> Option<&mut TrackState>

Source

pub fn active_clip(&self) -> Option<&Clip>

Source

pub fn active_clip_mut(&mut self) -> Option<&mut Clip>

Source

pub fn active_clip_track(&self) -> Option<&TrackState>

Trait Implementations§

Source§

impl Debug for NavState

Source§

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

Formats the value using the given formatter. 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> 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,