mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
delete autoremoved clips from pool
This commit is contained in:
parent
a9cfaf9767
commit
7af98b7008
2 changed files with 15 additions and 3 deletions
|
|
@ -210,14 +210,18 @@ impl Tek {
|
|||
|
||||
// Remove clip from arrangement when exiting empty clip editor
|
||||
pub fn clip_auto_remove (&mut self) {
|
||||
if let Some(ref pool) = self.pool
|
||||
if let Some(ref mut pool) = self.pool
|
||||
&& let Selection::Clip(t, s) = self.selected
|
||||
&& let Some(scene) = self.scenes.get_mut(s)
|
||||
&& let Some(slot) = scene.clips.get_mut(t)
|
||||
&& let Some(clip) = slot
|
||||
&& let Some(clip) = slot.as_mut()
|
||||
{
|
||||
let mut swapped = None;
|
||||
if clip.read().unwrap().count_midi_messages() == 0 {
|
||||
*slot = None;
|
||||
std::mem::swap(&mut swapped, slot);
|
||||
}
|
||||
if let Some(clip) = swapped {
|
||||
pool.delete_clip(&clip.read().unwrap());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue