wip(p66,e16)

This commit is contained in:
🪞👃🪞 2024-11-21 16:41:47 +01:00
parent e768790658
commit faf7576ad8
2 changed files with 6 additions and 5 deletions

View file

@ -153,7 +153,7 @@ impl<T: PhrasesControl> Command<T> for PhraseLengthCommand {
fn execute (self, state: &mut T) -> Perhaps<Self> { fn execute (self, state: &mut T) -> Perhaps<Self> {
use PhraseLengthFocus::*; use PhraseLengthFocus::*;
use PhraseLengthCommand::*; use PhraseLengthCommand::*;
let mode = state.phrases_mode_mut(); let mut mode = state.phrases_mode_mut().clone();
if let Some(PhrasesMode::Length( if let Some(PhrasesMode::Length(
phrase, phrase,
ref mut length, ref mut length,
@ -180,10 +180,11 @@ impl<T: PhrasesControl> Command<T> for PhraseLengthCommand {
Tick => { *length = length.saturating_sub(1) }, Tick => { *length = length.saturating_sub(1) },
}, },
Self::Set(length) => { Self::Set(length) => {
let mut phrase = state.phrases()[*phrase].write().unwrap(); let mut phrase = state.phrases()[phrase].write().unwrap();
let old_length = phrase.length; let old_length = phrase.length;
phrase.length = length; phrase.length = length;
*mode = None; std::mem::drop(phrase);
*state.phrases_mode_mut() = None;
return Ok(Some(Self::Set(old_length))) return Ok(Some(Self::Set(old_length)))
}, },
_ => unreachable!() _ => unreachable!()

View file

@ -44,8 +44,8 @@ impl ArrangerControl for ArrangerTui {
} }
fn activate (&mut self) { fn activate (&mut self) {
if let ArrangerSelection::Scene(s) = self.selected { if let ArrangerSelection::Scene(s) = self.selected {
for (t, track) in self.tracks().iter().enumerate() { for (t, track) in self.tracks.iter_mut().enumerate() {
let phrase = self.scenes()[s].clips[t].clone(); let phrase = self.scenes[s].clips[t].clone();
if track.player.play_phrase.is_some() || phrase.is_some() { if track.player.play_phrase.is_some() || phrase.is_some() {
track.enqueue_next(phrase.as_ref()); track.enqueue_next(phrase.as_ref());
} }