piano keys reappear

This commit is contained in:
i do not exist 2026-09-23 16:08:54 +03:00
parent 9db60c3429
commit 9a50ce6613
15 changed files with 856 additions and 782 deletions

View file

@ -87,13 +87,13 @@ impl_from!(AppCmd: |x: TracksCmd| AppCmd::Tracks { command: x });
#[command(MidiEdit = "edit")] pub fn cmd_midi_edit (&mut self, command: MidiEditCmd) -> Perhaps<AppCmd> {
Ok(command.dispatch(self)?.map(Into::into))
}
#[command(Scene = "scene")] pub fn cmd_scene (&mut self, command: SceneCmd) -> Perhaps<AppCmd> {
#[command(Scene = "scene")] pub fn cmd_scene (&mut self, command: SceneCmd) -> Perhaps<AppCmd> {
Ok(command.dispatch(self)?.map(Into::into))
}
#[command(Scenes = "scenes")] pub fn cmd_scenes (&mut self, command: ScenesCmd) -> Perhaps<AppCmd> {
Ok(command.dispatch(self)?.map(Into::into))
}
#[command(Track = "track")] pub fn cmd_track (&mut self, command: TrackCmd) -> Perhaps<AppCmd> {
#[command(Track = "track")] pub fn cmd_track (&mut self, command: TrackCmd) -> Perhaps<AppCmd> {
Ok(command.dispatch(self)?.map(Into::into))
}
#[command(Tracks = "tracks")] pub fn cmd_tracks (&mut self, command: TracksCmd) -> Perhaps<AppCmd> {
@ -534,13 +534,23 @@ impl<T: HasClip + HasEditor
*self.editor_mut() = None;
} else if let Some(clip) = self.clip() {
let editor = MidiEditor {
mode: Default::default(),
mode: PianoHorizontal {
keys_width: 5,
range: MidiSelection {
time_len: Arc::new(96usize.into()),
time_zoom: Arc::new(1usize.into()),
note_axis: Arc::new(12usize.into()),
..Default::default()
},
..Default::default()
},
size: Sizer(
Arc::new(0usize.into()),
Arc::new(0usize.into()),
Arc::new(16usize.into()),
Arc::new(6usize.into()),
),
};
*editor.mode.clip.0.write() = clip.clone();
editor.redraw();
*self.editor_mut() = Some(editor);
}
Ok(Some(MidiEditCmd::Toggle))
@ -627,7 +637,10 @@ impl<T> MidiClipControl for T where T: HasClip
&mut self
) -> Perhaps<MidiClipCmd> {
Ok(self.clip_mut().map(|mut clip|if clip.is_none() {
*clip = Some(Default::default());
*clip = Some(Arc::new(RwLock::new(MidiClip {
ppq: 24, length: 96,
..Default::default()
})));
None // TODO undo
} else {
None
@ -698,6 +711,38 @@ impl<T> BrowseControl for T where T:
}
}
#[tek_proc::command(AudioInput)]
#[tek_proc::keyword(AudioInput)]
#[derive(Debug)]
pub enum AudioInputCmd {
Close,
Connect(Arc<str>),
}
#[tek_proc::command(AudioOutput)]
#[tek_proc::keyword(AudioOutput)]
#[derive(Debug)]
pub enum AudioOutputCmd {
Close,
Connect(Arc<str>),
}
#[tek_proc::command(MidiInput)]
#[tek_proc::keyword(MidiInput)]
#[derive(Debug)]
pub enum MidiInputCmd {
Close,
Connect(Arc<str>),
}
#[tek_proc::command(MidiOutput)]
#[tek_proc::keyword(MidiOutput)]
#[derive(Debug)]
pub enum MidiOutputCmd {
Close,
Connect(Arc<str>),
}
//impl<T: HasPool
//+ Namespace<bool>
//+ Namespace<usize>