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
48
src/tek.rs
48
src/tek.rs
|
|
@ -172,9 +172,8 @@ pub struct App {
|
|||
pub project: Project,
|
||||
/// Error, if any
|
||||
pub error: Arc<RwLock<Option<Arc<str>>>>,
|
||||
#[cfg(feature = "prof2")]
|
||||
/// Tracing guard
|
||||
pub guard: Option<tracing_flame::FlushGuard<std::io::BufWriter<std::fs::File>>>,
|
||||
#[cfg(feature = "prof2")] pub guard: Option<tracing_flame::FlushGuard<std::io::BufWriter<std::fs::File>>>,
|
||||
}
|
||||
|
||||
impl App {
|
||||
|
|
@ -359,18 +358,17 @@ fn get_vec_arc_str <'a> (_: &App, _: impl Language) -> Perhaps<Vec<Arc<str>>> {
|
|||
todo!()
|
||||
}
|
||||
|
||||
impl_has!(Sizer: |self: App|self.size);
|
||||
impl_has!(Dialog: |self: App|self.dialog);
|
||||
impl_has!(Jack<'static>: |self: App|self.jack);
|
||||
|
||||
impl_has!(Clock: |self: App|self.project.clock);
|
||||
impl_has!(Clock: |self: App|self.project.clock);
|
||||
impl_has!(Dialog: |self: App|self.dialog);
|
||||
impl_has!(Jack<'static>: |self: App|self.jack);
|
||||
impl_has!(Pool<MidiClip>: |self: App|self.project.clips);
|
||||
impl_has!(Pool<Sample>: |self: App|self.project.samples);
|
||||
impl_has!(Selection: |self: App|self.project.selection);
|
||||
impl_as_ref!(Option<Project>: |self: App|todo!());
|
||||
impl_as_mut!(Option<Project>: |self: App|todo!());
|
||||
impl_as_ref!(Option<MidiEditor>: |self: App|self.project.as_ref());
|
||||
impl_as_mut!(Option<MidiEditor>: |self: App|self.project.as_mut());
|
||||
impl_has!(Pool<Sample>: |self: App|self.project.samples);
|
||||
impl_has!(Selection: |self: App|self.project.selection);
|
||||
impl_has!(Sizer: |self: App|self.size);
|
||||
impl_as_ref!(Option<Project>: |self: App|todo!());
|
||||
impl_as_mut!(Option<Project>: |self: App|todo!());
|
||||
impl_as_ref!(Option<MidiEditor>: |self: App|self.project.as_ref());
|
||||
impl_as_mut!(Option<MidiEditor>: |self: App|self.project.as_mut());
|
||||
impl HasClip for App {
|
||||
fn clip_slot (&self) -> Option<Slot<MidiClip>> {
|
||||
self.project.clip_slot()
|
||||
|
|
@ -548,26 +546,16 @@ impl Dialog {
|
|||
Self::Menu(1, Arc::new([
|
||||
|
||||
MenuItem::new(" Resume session ", [
|
||||
AppCmd::Project {
|
||||
command: ProjectCmd::LoadLast
|
||||
}
|
||||
AppCmd::Project { command: ProjectCmd::LoadLast }
|
||||
]),
|
||||
|
||||
MenuItem::new(" Create session ", [
|
||||
AppCmd::Dialog {
|
||||
dialog: Dialog::None
|
||||
},
|
||||
AppCmd::Mode {
|
||||
command: ModeCmd::Reset {
|
||||
modes: vec!["Arranger".into()]
|
||||
}
|
||||
},
|
||||
AppCmd::Tracks {
|
||||
command: TracksCmd::Add
|
||||
},
|
||||
AppCmd::Scenes {
|
||||
command: ScenesCmd::Add
|
||||
}
|
||||
AppCmd::Dialog { dialog: Dialog::None },
|
||||
AppCmd::Mode { command: ModeCmd::Reset { modes: vec!["Arranger".into()] } },
|
||||
AppCmd::Tracks { command: TracksCmd::Add },
|
||||
AppCmd::Scenes { command: ScenesCmd::Add },
|
||||
AppCmd::MidiClip { command: MidiClipCmd::Upsert },
|
||||
AppCmd::MidiEdit { command: MidiEditCmd::Toggle },
|
||||
]),
|
||||
|
||||
MenuItem::new(" Load session ", [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue