mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-10-08 18:56:42 +02:00
more reorg; newtype Binds and Views
This commit is contained in:
parent
3e3276bed0
commit
f10fa309e5
27 changed files with 1017 additions and 892 deletions
|
|
@ -54,7 +54,7 @@ pub struct Project {
|
|||
/// Display size of clips area
|
||||
pub size_inner: Sizer,
|
||||
/// Selected UI element
|
||||
pub selection: Selection,
|
||||
pub selection: Selection,
|
||||
/// Source of time
|
||||
#[cfg(feature = "clock")] pub clock: Clock,
|
||||
/// Allows one MIDI clip to be edited
|
||||
|
|
@ -138,12 +138,15 @@ impl Project {
|
|||
}
|
||||
|
||||
impl HasJack<'static> for Project { fn jack (&self) -> &Jack<'static> { &self.jack } }
|
||||
impl_has!(Jack<'static>: |self: Project| self.jack);
|
||||
impl_has!(Sizer: |self: Project| self.size);
|
||||
impl_has!(Clock: |self: Project| self.clock);
|
||||
impl_has!(Selection: |self: Project| self.selection);
|
||||
impl_as_ref_opt!(MidiEditor: |self: Project| self.editor.as_ref());
|
||||
impl_as_mut_opt!(MidiEditor: |self: Project| self.editor.as_mut());
|
||||
impl_has!(Jack<'static>: |self: Project| self.jack);
|
||||
impl_has!(Sizer: |self: Project| self.size);
|
||||
impl_has!(Clock: |self: Project| self.clock);
|
||||
impl_has!(Selection: |self: Project| self.selection);
|
||||
impl_has!(Vec<Scene>: |self: Project| self.scenes);
|
||||
impl_as_ref_opt!(Scene: |self: Project| self.selected_scene());
|
||||
impl_as_mut_opt!(Scene: |self: Project| self.selected_scene_mut());
|
||||
impl_as_ref!(Option<MidiEditor>: |self: Project| &self.editor);
|
||||
impl_as_mut!(Option<MidiEditor>: |self: Project| &mut self.editor);
|
||||
|
||||
pub fn swap_value <T: Clone + PartialEq, U> (
|
||||
target: &mut T, value: &T, returned: impl Fn(T)->U
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue