mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-10-08 18:56:42 +02:00
open editor
This commit is contained in:
parent
fdee3fbfc8
commit
6aff4e55a6
6 changed files with 212 additions and 303 deletions
|
|
@ -400,7 +400,7 @@ impl<T: HasScene
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: HasEditor
|
||||
impl<T: HasClip + HasEditor
|
||||
+ Namespace<u32>
|
||||
+ Namespace<f64>
|
||||
+ Namespace<bool>
|
||||
|
|
@ -409,7 +409,7 @@ impl<T: HasEditor
|
|||
+ Namespace<ClipSlot>
|
||||
> MidiEditControl for T {}
|
||||
|
||||
#[tek_proc::commands(MidiEditCmd)] pub trait MidiEditControl: HasEditor
|
||||
#[tek_proc::commands(MidiEditCmd)] pub trait MidiEditControl: HasClip + HasEditor
|
||||
+ Namespace<u32>
|
||||
+ Namespace<f64>
|
||||
+ Namespace<bool>
|
||||
|
|
@ -420,8 +420,16 @@ impl<T: HasEditor
|
|||
#[command(Toggle = "toggle")] fn edit_toggle (&mut self) -> Perhaps<MidiEditCmd> {
|
||||
if self.is_editing() {
|
||||
*self.editor_mut() = None;
|
||||
} else {
|
||||
todo!()
|
||||
} else if let Some(clip) = self.clip() {
|
||||
let editor = MidiEditor {
|
||||
mode: Default::default(),
|
||||
size: Sizer(
|
||||
Arc::new(0usize.into()),
|
||||
Arc::new(0usize.into()),
|
||||
),
|
||||
};
|
||||
*editor.mode.clip.0.write() = clip.clone();
|
||||
*self.editor_mut() = Some(editor);
|
||||
}
|
||||
Ok(Some(MidiEditCmd::Toggle))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue