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§clip_view: ClipViewState§clip_view_visible: bool§clip_view_target: Option<(usize, usize)>(track_idx, clip_idx) shown in clip view.
FX menu state (per-track fx button).
instrument_modal: InstrumentModal§loop_editor: LoopEditor§transport_ui: TransportUiState§tracks: Vec<TrackState>§input_modal: InputModalText input modal (for save/open file paths).
confirm_modal: ConfirmModalConfirmation modal (for delete actions).
undo_stack: UndoStackUndo/redo stack.
clip_locked: boolWhether a clip is “locked” for editing (Enter locks, Esc unlocks). When locked, h/l moves the clip instead of navigating between elements.
recording_grace: usizeGrace 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§
Toggle the space menu open/closed.
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.
pub fn focus_pane(&mut self, pane: Pane)
pub fn focus_next_pane(&mut self)
pub fn move_up(&mut self)
pub fn move_down(&mut self)
pub fn move_left(&mut self)
pub fn move_right(&mut self)
Sourcepub fn adjust_setting(&mut self, direction: i32)
pub fn adjust_setting(&mut self, direction: i32)
Adjust the currently selected setting in the Settings tab.
Sourcepub fn enter(&mut self) -> Option<SpaceAction>
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.
pub fn escape(&mut self)
Sourcepub fn cycle_tab(&mut self)
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…
Sourcepub fn adjust_synth_param(&mut self, delta: f32) -> Option<(usize, usize, f32)>
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.
Sourcepub fn show_current_track_controls(&mut self)
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.
pub fn toggle_mute(&mut self)
pub fn toggle_solo(&mut self)
pub fn toggle_arm(&mut self)
pub fn digit_input(&mut self, ch: char)
pub fn tick(&mut self)
pub fn jump_to_clip(&mut self, clip_number: usize)
pub fn activate_element(&mut self)
Sourcepub fn add_instrument_track(
&mut self,
instrument: InstrumentType,
mixer_id: usize,
handle: Arc<TrackHandle>,
)
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.
pub fn open_clip_view(&mut self, track_idx: usize, clip_idx: usize)
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.
pub fn active_fx_chain_len(&self) -> usize
Sourcepub fn sync_clip_view_target(&mut self)
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.
Sourcepub fn dedup_clips(&mut self) -> Vec<(usize, usize)>
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.
Sourcepub fn receive_clip_snapshot(
&mut self,
snap: ClipSnapshot,
is_recording: bool,
) -> Option<(usize, usize)>
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.