mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
add clips with enter
This commit is contained in:
parent
156504b5ba
commit
efa35834de
3 changed files with 33 additions and 26 deletions
|
|
@ -5,6 +5,11 @@ pub type ClipPool = Vec<Arc<RwLock<MidiClip>>>;
|
|||
pub trait HasClips {
|
||||
fn clips <'a> (&'a self) -> std::sync::RwLockReadGuard<'a, ClipPool>;
|
||||
fn clips_mut <'a> (&'a self) -> std::sync::RwLockWriteGuard<'a, ClipPool>;
|
||||
fn add_clip (&self) -> (usize, Arc<RwLock<MidiClip>>) {
|
||||
let clip = Arc::new(RwLock::new(MidiClip::new("Clip", true, 384, None, None)));
|
||||
self.clips_mut().push(clip.clone());
|
||||
(self.clips().len() - 1, clip)
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export] macro_rules! has_clips {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue