mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
arranger: editor now toggles
This commit is contained in:
parent
b0393184fa
commit
4f3a50f2d6
2 changed files with 18 additions and 11 deletions
|
|
@ -19,19 +19,25 @@ handle!(TuiIn: |self: App, input|Ok(if let Some(command) = self.config.keys.comm
|
||||||
|
|
||||||
#[tengri_proc::command(App)] impl AppCommand {
|
#[tengri_proc::command(App)] impl AppCommand {
|
||||||
fn edit (app: &mut App) -> Perhaps<Self> {
|
fn edit (app: &mut App) -> Perhaps<Self> {
|
||||||
let selection = app.selection().clone();
|
app.project.editor = if app.project.editor.is_some() {
|
||||||
Ok(match selection {
|
None
|
||||||
Selection::TrackClip { track, scene } => {
|
} else {
|
||||||
let clip = &mut app.scenes_mut()[scene].clips[track];
|
let selection = app.selection().clone();
|
||||||
if clip.is_none() {
|
match selection {
|
||||||
//app.clip_auto_create();
|
Selection::TrackClip { track, scene } => {
|
||||||
*clip = Some(Default::default());
|
let clip = &mut app.scenes_mut()[scene].clips[track];
|
||||||
|
if clip.is_none() {
|
||||||
|
//app.clip_auto_create();
|
||||||
|
*clip = Some(Default::default());
|
||||||
|
}
|
||||||
|
clip.as_ref().map(|c|c.into())
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
None
|
||||||
}
|
}
|
||||||
app.project.editor = clip.as_ref().map(|c|c.into());
|
|
||||||
None
|
|
||||||
}
|
}
|
||||||
_ => None
|
};
|
||||||
})
|
Ok(None)
|
||||||
}
|
}
|
||||||
fn dialog (app: &mut App, dialog: Option<Dialog>) -> Perhaps<Self> {
|
fn dialog (app: &mut App, dialog: Option<Dialog>) -> Perhaps<Self> {
|
||||||
app.toggle_dialog(dialog);
|
app.toggle_dialog(dialog);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ use crate::*;
|
||||||
|
|
||||||
impl Content<TuiOut> for Arrangement {
|
impl Content<TuiOut> for Arrangement {
|
||||||
fn content (&self) -> impl Render<TuiOut> {
|
fn content (&self) -> impl Render<TuiOut> {
|
||||||
|
panic!();
|
||||||
let ins = |x|Bsp::n(self.view_inputs_0(), x);
|
let ins = |x|Bsp::n(self.view_inputs_0(), x);
|
||||||
let tracks = |x|Bsp::s(self.view_tracks_0(), x);
|
let tracks = |x|Bsp::s(self.view_tracks_0(), x);
|
||||||
let devices = |x|Bsp::s(self.view_devices_0(), x);
|
let devices = |x|Bsp::s(self.view_devices_0(), x);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue