mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-10-08 18:56:42 +02:00
tek_has
This commit is contained in:
parent
0a89fab28a
commit
9e3cc1139d
18 changed files with 450 additions and 414 deletions
|
|
@ -1,13 +1,9 @@
|
|||
#![allow(unused)]
|
||||
use crate::*;
|
||||
|
||||
pub trait HasEditor: AsRef<Option<MidiEditor>> + AsMut<Option<MidiEditor>> {
|
||||
fn editor (&self) -> &Option<MidiEditor> {
|
||||
self.as_ref()
|
||||
}
|
||||
fn editor_mut (&mut self) -> &mut Option<MidiEditor> {
|
||||
self.as_mut()
|
||||
}
|
||||
impl<T: HasEditor> EditorModel for T {}
|
||||
|
||||
pub trait EditorModel: HasEditor {
|
||||
fn is_editing (&self) -> bool {
|
||||
self.editor().is_some()
|
||||
}
|
||||
|
|
@ -19,8 +15,6 @@ pub trait HasEditor: AsRef<Option<MidiEditor>> + AsMut<Option<MidiEditor>> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> HasEditor for T where T: AsRef<Option<MidiEditor>> + AsMut<Option<MidiEditor>> {}
|
||||
|
||||
/// Contains state for viewing and editing a clip.
|
||||
///
|
||||
/// ```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue