wip: refactor pt.15: 107 errors

This commit is contained in:
🪞👃🪞 2024-11-11 00:39:45 +01:00
parent 8b68a993bc
commit 5823d0b746
8 changed files with 423 additions and 455 deletions

View file

@ -113,12 +113,12 @@ impl ArrangementScene {
/// Returns true if all phrases in the scene are
/// currently playing on the given collection of tracks.
pub fn is_playing (&self, tracks: &[MIDIPlayer]) -> bool {
pub fn is_playing (&self, tracks: &[ArrangementTrack]) -> bool {
self.clips.iter().any(|clip|clip.is_some()) && self.clips.iter().enumerate()
.all(|(track_index, clip)|match clip {
Some(clip) => tracks
.get(track_index)
.map(|track|if let Some((_, Some(phrase))) = &track.phrase {
.map(|track|if let Some((_, Some(phrase))) = &track.player.phrase {
*phrase.read().unwrap() == *clip.read().unwrap()
} else {
false

View file

@ -14,9 +14,9 @@ pub enum ArrangementCommand {
#[derive(Clone)]
pub enum ArrangementSceneCommand {
Add,
Delete,
Delete(usize),
RandomColor,
Play,
Play(usize),
Swap(usize),
SetSize(usize),
SetZoom(usize),
@ -25,7 +25,7 @@ pub enum ArrangementSceneCommand {
#[derive(Clone)]
pub enum ArrangementTrackCommand {
Add,
Delete,
Delete(usize),
RandomColor,
Stop,
Swap(usize),