mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-09-18 12:56:42 +02:00
This commit is contained in:
parent
f353cc0388
commit
f57ca9af84
3 changed files with 81 additions and 21 deletions
|
|
@ -89,12 +89,14 @@ pub trait SceneController: HasScene
|
||||||
{
|
{
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[command(SetZoom = "zoom")]
|
#[command(SetZoom = "zoom")]
|
||||||
fn scene_set_zoom (&mut self, _size: usize) -> Perhaps<SceneCommand>
|
fn scene_set_zoom (&mut self, _size: usize) -> Perhaps<SceneCommand>
|
||||||
where Self: Namespace<usize>
|
where Self: Namespace<usize>
|
||||||
{
|
{
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[command(SetName = "name")]
|
#[command(SetName = "name")]
|
||||||
fn scene_set_name (&mut self, name: Arc<str>) -> Perhaps<SceneCommand>
|
fn scene_set_name (&mut self, name: Arc<str>) -> Perhaps<SceneCommand>
|
||||||
where Self: Namespace<Arc<str>>
|
where Self: Namespace<Arc<str>>
|
||||||
|
|
@ -105,6 +107,7 @@ pub trait SceneController: HasScene
|
||||||
|name|SceneCommand::SetName { name }
|
|name|SceneCommand::SetName { name }
|
||||||
)).transpose()?.flatten())
|
)).transpose()?.flatten())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[command(SetColor = "color")]
|
#[command(SetColor = "color")]
|
||||||
fn scene_set_color (&mut self, color: ItemTheme) -> Perhaps<SceneCommand>
|
fn scene_set_color (&mut self, color: ItemTheme) -> Perhaps<SceneCommand>
|
||||||
where Self: Namespace<ItemTheme>
|
where Self: Namespace<ItemTheme>
|
||||||
|
|
@ -173,6 +176,7 @@ pub trait HasScenes: AsRef<Vec<Scene>> + AsMut<Vec<Scene>> {
|
||||||
impl<T: HasScenes
|
impl<T: HasScenes
|
||||||
+ HasTracks
|
+ HasTracks
|
||||||
+ HasTrackScroll
|
+ HasTrackScroll
|
||||||
|
+ HasSelection
|
||||||
+ HasJack<'static>
|
+ HasJack<'static>
|
||||||
+ Namespace<usize>
|
+ Namespace<usize>
|
||||||
+ Namespace<Option<ItemTheme>>
|
+ Namespace<Option<ItemTheme>>
|
||||||
|
|
@ -183,6 +187,7 @@ impl<T: HasScenes
|
||||||
pub trait ScenesController: HasScenes
|
pub trait ScenesController: HasScenes
|
||||||
+ HasTracks
|
+ HasTracks
|
||||||
+ HasTrackScroll
|
+ HasTrackScroll
|
||||||
|
+ HasSelection
|
||||||
+ HasJack<'static>
|
+ HasJack<'static>
|
||||||
+ Namespace<usize>
|
+ Namespace<usize>
|
||||||
+ Namespace<Option<ItemTheme>>
|
+ Namespace<Option<ItemTheme>>
|
||||||
|
|
@ -196,6 +201,29 @@ pub trait ScenesController: HasScenes
|
||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
#[command(Select = "select")]
|
||||||
|
fn scene_select (&mut self) -> Perhaps<ScenesCommand> {
|
||||||
|
let scenes = self.scenes().len();
|
||||||
|
let select = self.selection_mut().select_scene(scenes);
|
||||||
|
*self.selection_mut() = select;
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[command(Next = "next")]
|
||||||
|
fn scene_select_next (&mut self) -> Perhaps<ScenesCommand> {
|
||||||
|
let scenes = self.scenes().len();
|
||||||
|
let select = self.selection().select_scene_next(scenes);
|
||||||
|
*self.selection_mut() = select;
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[command(Prev = "prev")]
|
||||||
|
fn scene_select_prev (&mut self) -> Perhaps<ScenesCommand> {
|
||||||
|
let select = self.selection_mut().select_scene_prev();
|
||||||
|
*self.selection_mut() = select;
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait ScenesView: HasEditor + HasSelection + HasSceneScroll + HasClipsSize + Send + Sync {
|
pub trait ScenesView: HasEditor + HasSelection + HasSceneScroll + HasClipsSize + Send + Sync {
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,7 @@ pub trait HasTracks: AsRef<Vec<Track>> + AsMut<Vec<Track>> + HasClock + HasTrack
|
||||||
|
|
||||||
impl<T: HasTracks
|
impl<T: HasTracks
|
||||||
+ HasScenes
|
+ HasScenes
|
||||||
|
+ HasSelection
|
||||||
+ HasJack<'static>
|
+ HasJack<'static>
|
||||||
+ Namespace<usize>
|
+ Namespace<usize>
|
||||||
+ Namespace<Arc<[Connect]>>
|
+ Namespace<Arc<[Connect]>>
|
||||||
|
|
@ -274,6 +275,7 @@ impl<T: HasTracks
|
||||||
#[tek_proc::commands(TracksCommand)]
|
#[tek_proc::commands(TracksCommand)]
|
||||||
pub trait TracksController: HasTracks
|
pub trait TracksController: HasTracks
|
||||||
+ HasScenes
|
+ HasScenes
|
||||||
|
+ HasSelection
|
||||||
+ HasJack<'static>
|
+ HasJack<'static>
|
||||||
+ Namespace<usize>
|
+ Namespace<usize>
|
||||||
+ Namespace<Arc<[Connect]>>
|
+ Namespace<Arc<[Connect]>>
|
||||||
|
|
@ -316,6 +318,29 @@ pub trait TracksController: HasTracks
|
||||||
let (_index, _) = self.tracks_add_one(None, None, [].into(), [].into())?;
|
let (_index, _) = self.tracks_add_one(None, None, [].into(), [].into())?;
|
||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[command(Select = "select")]
|
||||||
|
fn track_select (&mut self) -> Perhaps<TracksCommand> {
|
||||||
|
let tracks = self.tracks().len();
|
||||||
|
let select = self.selection_mut().select_track(tracks);
|
||||||
|
*self.selection_mut() = select;
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[command(Next = "next")]
|
||||||
|
fn track_select_next (&mut self) -> Perhaps<TracksCommand> {
|
||||||
|
let tracks = self.tracks().len();
|
||||||
|
let select = self.selection().select_track_next(tracks);
|
||||||
|
*self.selection_mut() = select;
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[command(Prev = "prev")]
|
||||||
|
fn track_select_prev (&mut self) -> Perhaps<TracksCommand> {
|
||||||
|
let select = self.selection_mut().select_track_prev();
|
||||||
|
*self.selection_mut() = select;
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
|
|
|
||||||
45
src/tek.edn
45
src/tek.edn
|
|
@ -45,27 +45,35 @@
|
||||||
(bar/e 12 (bg (g 50) :scenes/names)
|
(bar/e 12 (bg (g 50) :scenes/names)
|
||||||
(align/c :scenes/clips))))))))))))))
|
(align/c :scenes/clips))))))))))))))
|
||||||
|
|
||||||
(keys :clock (@space clock/toggle 0)
|
|
||||||
(@shift/space clock/toggle 0))
|
|
||||||
|
|
||||||
(keys :color (@c color))
|
|
||||||
|
|
||||||
(keys :launch (@q launch))
|
|
||||||
|
|
||||||
(keys :scenes (@shift/S (scenes add))
|
|
||||||
(@s (select scene))
|
|
||||||
(@up (select scene-dec))
|
|
||||||
(@down (select scene-inc)))
|
|
||||||
|
|
||||||
(keys :tracks (@shift/T (tracks add))
|
|
||||||
(@t (select track))
|
|
||||||
(@left (select track-dec))
|
|
||||||
(@right (select track-inc)))
|
|
||||||
|
|
||||||
(keys :global (see :history :saveload)
|
(keys :global (see :history :saveload)
|
||||||
(@f8 dialog :options)
|
(@f8 dialog :options)
|
||||||
(@f10 dialog :quit))
|
(@f10 dialog :quit))
|
||||||
|
|
||||||
|
(keys :clock
|
||||||
|
(@space clock/toggle 0)
|
||||||
|
(@shift/space clock/toggle 0))
|
||||||
|
|
||||||
|
(keys :color
|
||||||
|
(@c color))
|
||||||
|
|
||||||
|
(keys :launch
|
||||||
|
(@q launch))
|
||||||
|
|
||||||
|
(keys :scenes
|
||||||
|
(@shift/S (scenes add))
|
||||||
|
(@s (scenes select))
|
||||||
|
(@up (scenes prev))
|
||||||
|
(@down (scenes next)))
|
||||||
|
|
||||||
|
(keys :tracks
|
||||||
|
(@shift/T (tracks add))
|
||||||
|
(@t (tracks select))
|
||||||
|
(@left (tracks prev))
|
||||||
|
(@right (tracks next)))
|
||||||
|
|
||||||
|
(keys :clip (see :color :launch :axis/z :axis/z2 :delete)
|
||||||
|
(@l (toggle :loop)))
|
||||||
|
|
||||||
(view :ports/out
|
(view :ports/out
|
||||||
(bsp/s (align/w (text L-AUDIO-OUT))
|
(bsp/s (align/w (text L-AUDIO-OUT))
|
||||||
(bsp/e (text MIDI-OUT)
|
(bsp/e (text MIDI-OUT)
|
||||||
|
|
@ -132,6 +140,7 @@
|
||||||
(keys :axis/w2 (@openbrace dec :w2)
|
(keys :axis/w2 (@openbrace dec :w2)
|
||||||
(@closebrace inc :w2))
|
(@closebrace inc :w2))
|
||||||
(keys :focus)
|
(keys :focus)
|
||||||
|
|
||||||
(keys :editor (see :axis/i :axis/i2 :axis/y
|
(keys :editor (see :axis/i :axis/i2 :axis/y
|
||||||
:page :editor/view :editor/add :editor/del))
|
:page :editor/view :editor/add :editor/del))
|
||||||
(keys :editor/view (see :axis/x :axis/x2 :axis/z :axis/z2)
|
(keys :editor/view (see :axis/x :axis/x2 :axis/z :axis/z2)
|
||||||
|
|
@ -169,8 +178,6 @@
|
||||||
(@r redo 1))
|
(@r redo 1))
|
||||||
(keys :saveload (@f6 dialog :save)
|
(keys :saveload (@f6 dialog :save)
|
||||||
(@f9 dialog :load))
|
(@f9 dialog :load))
|
||||||
(keys :clip (see :color :launch :axis/z :axis/z2 :delete)
|
|
||||||
(@l toggle :loop))
|
|
||||||
(keys :sequencer (see :color :launch)
|
(keys :sequencer (see :color :launch)
|
||||||
(@shift/I input/add)
|
(@shift/I input/add)
|
||||||
(@shift/O output/add))
|
(@shift/O output/add))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue