allow adding scenes
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
i do not exist 2026-08-12 20:58:59 +03:00
parent da2099c52e
commit d9e17cd348
2 changed files with 49 additions and 36 deletions

View file

@ -83,19 +83,19 @@ pub trait SceneController: HasScene
+ Namespace<Arc<str>> + Namespace<Arc<str>>
+ Namespace<ItemTheme> + Namespace<ItemTheme>
{ {
#[command(SetSize = "scene/size")] #[command(SetSize = "size")]
fn scene_set_size (&mut self, _size: usize) -> Perhaps<SceneCommand> fn scene_set_size (&mut self, _size: usize) -> Perhaps<SceneCommand>
where Self: Namespace<usize> where Self: Namespace<usize>
{ {
todo!() todo!()
} }
#[command(SetZoom = "scene/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 = "scene/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,7 +105,7 @@ pub trait SceneController: HasScene
|name|SceneCommand::SetName { name } |name|SceneCommand::SetName { name }
)).transpose()?.flatten()) )).transpose()?.flatten())
} }
#[command(SetColor = "scene/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>
{ {
@ -171,6 +171,9 @@ pub trait HasScenes: AsRef<Vec<Scene>> + AsMut<Vec<Scene>> {
} }
impl<T: HasScenes impl<T: HasScenes
+ HasTracks
+ HasTrackScroll
+ HasJack<'static>
+ Namespace<usize> + Namespace<usize>
+ Namespace<Option<ItemTheme>> + Namespace<Option<ItemTheme>>
+ Namespace<Option<Arc<str>>> + Namespace<Option<Arc<str>>>
@ -178,10 +181,20 @@ impl<T: HasScenes
#[tek_proc::commands(ScenesCommand)] #[tek_proc::commands(ScenesCommand)]
pub trait ScenesController: HasScenes pub trait ScenesController: HasScenes
+ HasTracks
+ HasTrackScroll
+ HasJack<'static>
+ Namespace<usize> + Namespace<usize>
+ Namespace<Option<ItemTheme>> + Namespace<Option<ItemTheme>>
+ Namespace<Option<Arc<str>>> + Namespace<Option<Arc<str>>>
{ {
#[command(Add = "add")]
fn scenes_add (&mut self) -> Perhaps<ScenesCommand>
where Self: HasScenes + HasJack<'static>
{
let (_index, _) = self.scenes_add_one(None, None)?;
Ok(None)
}
// TODO // TODO
} }

View file

@ -56,15 +56,15 @@
(keys :launch (@q launch)) (keys :launch (@q launch))
(keys :scenes (@s (select :select/scene)) (keys :scenes (@shift/S (scenes add))
(@shift/S (scenes add)) (@s (select scene))
(@up (select :select/scene/dec)) (@up (select scene-dec))
(@down (select :select/scene/inc))) (@down (select scene-inc)))
(keys :tracks (@t (select :select/track)) (keys :tracks (@shift/T (tracks add))
(@shift/T (tracks add)) (@t (select track))
(@left (select :select/track/dec)) (@left (select track-dec))
(@right (select :select/track/inc))) (@right (select track-inc)))
(keys :global (see :history :saveload) (keys :global (see :history :saveload)
(@f8 dialog :options) (@f8 dialog :options)