wip: fixing runtime crashes, pt.1

(you thought this was over?)
This commit is contained in:
🪞👃🪞 2024-11-21 18:42:57 +01:00
parent 132093f14a
commit 94a16b9dbc
3 changed files with 32 additions and 32 deletions

View file

@ -12,7 +12,7 @@ impl<'a, T: TransportViewState> Content for TransportView<'a, T> {
Some(TransportState::Rolling) => "▶ PLAYING", Some(TransportState::Rolling) => "▶ PLAYING",
Some(TransportState::Starting) => "READY ...", Some(TransportState::Starting) => "READY ...",
Some(TransportState::Stopped) => "⏹ STOPPED", Some(TransportState::Stopped) => "⏹ STOPPED",
_ => unreachable!(), _ => "???",
} }
).min_xy(11, 2).push_x(1)).align_x().fill_x(), ).min_xy(11, 2).push_x(1)).align_x().fill_x(),

View file

@ -58,59 +58,59 @@ macro_rules! impl_midi_player {
&mut self$(.$field)*.reset &mut self$(.$field)*.reset
} }
fn phrase (&self) -> &Option<(Instant, Option<Arc<RwLock<Phrase>>>)> { fn phrase (&self) -> &Option<(Instant, Option<Arc<RwLock<Phrase>>>)> {
todo!() todo!("phrase")
} }
fn phrase_mut (&self) -> &mut Option<(Instant, Option<Arc<RwLock<Phrase>>>)> { fn phrase_mut (&self) -> &mut Option<(Instant, Option<Arc<RwLock<Phrase>>>)> {
todo!() todo!("phrase_mut")
} }
fn next_phrase (&self) -> &Option<(Instant, Option<Arc<RwLock<Phrase>>>)> { fn next_phrase (&self) -> &Option<(Instant, Option<Arc<RwLock<Phrase>>>)> {
todo!() todo!("next_phrase")
} }
fn next_phrase_mut (&mut self) -> &mut Option<(Instant, Option<Arc<RwLock<Phrase>>>)> { fn next_phrase_mut (&mut self) -> &mut Option<(Instant, Option<Arc<RwLock<Phrase>>>)> {
todo!() todo!("next_phrase_mut")
} }
} }
impl MidiInputApi for $Struct { impl MidiInputApi for $Struct {
fn midi_ins(&self) -> &Vec<Port<jack::MidiIn>> { fn midi_ins (&self) -> &Vec<Port<jack::MidiIn>> {
todo!() todo!("midi_ins")
} }
fn midi_ins_mut(&self) -> &mut Vec<Port<jack::MidiIn>> { fn midi_ins_mut (&self) -> &mut Vec<Port<jack::MidiIn>> {
todo!() todo!("midi_ins_mut")
} }
fn recording(&self) -> bool { fn recording (&self) -> bool {
todo!() todo!("recording")
} }
fn recording_mut(&mut self) -> &mut bool { fn recording_mut (&mut self) -> &mut bool {
todo!() todo!("recording_mut")
} }
fn monitoring(&self) -> bool { fn monitoring (&self) -> bool {
todo!() todo!("monitoring")
} }
fn monitoring_mut(&mut self) -> &mut bool { fn monitoring_mut (&mut self) -> &mut bool {
todo!() todo!("monitoring_mut")
} }
fn overdub(&self) -> bool { fn overdub (&self) -> bool {
todo!() todo!("overdub")
} }
fn overdub_mut(&mut self) -> &mut bool { fn overdub_mut (&mut self) -> &mut bool {
todo!() todo!("overdub_mut")
} }
fn notes_in(&self) -> &Arc<RwLock<[bool; 128]>> { fn notes_in (&self) -> &Arc<RwLock<[bool; 128]>> {
todo!() todo!("notes_in")
} }
} }
impl MidiOutputApi for $Struct { impl MidiOutputApi for $Struct {
fn midi_outs (&self) -> &Vec<Port<jack::MidiOut>> { fn midi_outs (&self) -> &Vec<Port<jack::MidiOut>> {
todo!() todo!("midi_outs")
} }
fn midi_outs_mut (&mut self) -> &mut Vec<Port<jack::MidiOut>> { fn midi_outs_mut (&mut self) -> &mut Vec<Port<jack::MidiOut>> {
todo!() todo!("midi_outs_mut")
} }
fn midi_note (&mut self) -> &mut Vec<u8> { fn midi_note (&mut self) -> &mut Vec<u8> {
todo!() todo!("midi_note")
} }
fn notes_out (&self) -> &Arc<RwLock<[bool; 128]>> { fn notes_out (&self) -> &Arc<RwLock<[bool; 128]>> {
todo!() todo!("notes_out")
} }
} }
impl MidiPlayerApi for $Struct {} impl MidiPlayerApi for $Struct {}
@ -144,10 +144,10 @@ macro_rules! impl_phrase_editor_control {
//state.editor.phrase = phrase.clone(); //state.editor.phrase = phrase.clone();
//state.focus(ArrangerFocus::PhraseEditor); //state.focus(ArrangerFocus::PhraseEditor);
//state.focus_enter(); //state.focus_enter();
todo!() todo!("edit_phrase")
} }
fn editing_phrase (&self) -> &Option<Arc<RwLock<Phrase>>> { fn editing_phrase (&self) -> &Option<Arc<RwLock<Phrase>>> {
todo!() todo!("editing_phrase")
} }
fn phrase_editor_entered (&self) -> bool { fn phrase_editor_entered (&self) -> bool {
self.entered && self.focused() == $Focus self.entered && self.focused() == $Focus
@ -165,7 +165,7 @@ macro_rules! impl_phrase_editor_control {
&mut self.editor.note_len &mut self.editor.note_len
} }
fn put_note (&mut self) { fn put_note (&mut self) {
todo!() todo!("put_note")
} }
} }
} }

View file

@ -26,7 +26,7 @@ impl TryFrom<&Arc<RwLock<JackClient>>> for SequencerTui {
cursor: (0, 0), cursor: (0, 0),
entered: false, entered: false,
split: 20, split: 20,
midi_buf: vec![], midi_buf: vec![vec![];65536],
note_buf: vec![], note_buf: vec![],
transport, transport,
}) })
@ -54,7 +54,7 @@ impl TryFrom<&Arc<RwLock<JackClient>>> for ArrangerTui {
entered: false, entered: false,
menu_bar: None, menu_bar: None,
status_bar: None, status_bar: None,
midi_buf: vec![], midi_buf: vec![vec![];65536],
note_buf: vec![], note_buf: vec![],
}) })
} }