mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
chore: format
This commit is contained in:
parent
a3c21fa192
commit
4aadc712b8
4 changed files with 109 additions and 97 deletions
76
src/main.rs
76
src/main.rs
|
|
@ -72,57 +72,75 @@ pub fn main () -> Usually<()> {
|
|||
]))?,
|
||||
|
||||
];
|
||||
state.tracks[0].sequence = Some(0);
|
||||
state.tracks[1].sequence = Some(0);
|
||||
state.track_cursor = 1;
|
||||
state.scene_cursor = 1;
|
||||
state.note_start = 12;
|
||||
//for track in state.tracks.iter() {
|
||||
//if let Some(port) = track.midi_ins()?.get(0) {
|
||||
//client.connect_ports(&track.midi_out, port)?;
|
||||
//}
|
||||
//}
|
||||
state.tracks[0].sequence = Some(0);
|
||||
state.tracks[1].sequence = Some(0);
|
||||
state.track_cursor = 1;
|
||||
state.scene_cursor = 1;
|
||||
state.note_start = 12;
|
||||
state.time_zoom = 12;
|
||||
state.midi_in = Some(client.register_port("midi-in", MidiIn)?);
|
||||
state.transport = Some(client.transport());
|
||||
state.playing = Some(TransportState::Stopped);
|
||||
state.time_zoom = 12;
|
||||
state.jack = Some(jack);
|
||||
state.jack = Some(jack);
|
||||
Ok(())
|
||||
}))
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct App {
|
||||
/// Paths to user directories
|
||||
pub xdg: Option<Arc<XdgApp>>,
|
||||
/// Main JACK client.
|
||||
pub jack: Option<DynamicAsyncClient>,
|
||||
pub grid_mode: bool,
|
||||
pub chain_mode: bool,
|
||||
pub seq_mode: bool,
|
||||
pub scenes: Vec<Scene>,
|
||||
pub scene_cursor: usize,
|
||||
pub tracks: Vec<Track>,
|
||||
pub track_cursor: usize,
|
||||
pub frame: usize,
|
||||
pub modal: Option<Box<dyn Component>>,
|
||||
pub section: usize,
|
||||
pub entered: bool,
|
||||
pub playing: Option<TransportState>,
|
||||
pub transport: Option<Transport>,
|
||||
pub timebase: Arc<Timebase>,
|
||||
pub playhead: usize,
|
||||
/// Main MIDI controller.
|
||||
pub midi_in: Option<Port<MidiIn>>,
|
||||
/// Main audio outputs.
|
||||
pub audio_outs: Option<Vec<Port<AudioOut>>>,
|
||||
/// JACK transport handle.
|
||||
pub transport: Option<Transport>,
|
||||
/// Transport status
|
||||
pub playing: Option<TransportState>,
|
||||
/// Current transport position
|
||||
pub playhead: usize,
|
||||
/// Current sample rate and tempo.
|
||||
pub timebase: Arc<Timebase>,
|
||||
/// Display mode of grid section
|
||||
pub grid_mode: bool,
|
||||
/// Display mode of chain section
|
||||
pub chain_mode: bool,
|
||||
/// Display mode of sequencer seciton
|
||||
pub seq_mode: bool,
|
||||
/// Optional modal dialog
|
||||
pub modal: Option<Box<dyn Component>>,
|
||||
/// Currently focused section
|
||||
pub section: usize,
|
||||
/// Whether the section is focused
|
||||
pub entered: bool,
|
||||
/// Current frame
|
||||
pub metronome: bool,
|
||||
/// Display position of cursor within note range
|
||||
pub note_cursor: usize,
|
||||
/// Range of notes to display
|
||||
pub note_start: usize,
|
||||
/// Position of cursor within note range
|
||||
pub note_cursor: usize,
|
||||
pub note_start: usize,
|
||||
/// Display position of cursor within time range
|
||||
pub time_cursor: usize,
|
||||
/// PPQ per display unit
|
||||
pub time_zoom: usize,
|
||||
pub time_zoom: usize,
|
||||
/// Range of time steps to display
|
||||
pub time_start: usize,
|
||||
/// Position of cursor within time range
|
||||
pub time_cursor: usize,
|
||||
pub time_start: usize,
|
||||
/// Focused scene+1, 0 is track list
|
||||
pub scene_cursor: usize,
|
||||
/// Collection of scenes
|
||||
pub scenes: Vec<Scene>,
|
||||
/// Focused track+1, 0 is scene list
|
||||
pub track_cursor: usize,
|
||||
/// Collection of tracks
|
||||
pub tracks: Vec<Track>,
|
||||
}
|
||||
|
||||
process!(App |self, _client, scope| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue