mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-10 21:56:42 +01:00
arranger: rename track/scene/clip
This commit is contained in:
parent
ea463db139
commit
70b1ec5a02
15 changed files with 53 additions and 40 deletions
|
|
@ -3,7 +3,7 @@ use crate::*;
|
|||
/// A collection of phrases to play on each track.
|
||||
#[derive(Default)]
|
||||
pub struct Scene {
|
||||
pub name: String,
|
||||
pub name: Arc<RwLock<String>>,
|
||||
pub clips: Vec<Option<usize>>,
|
||||
}
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ impl Scene {
|
|||
Ok(scene)
|
||||
}
|
||||
pub fn new (name: impl AsRef<str>, clips: impl AsRef<[Option<usize>]>) -> Self {
|
||||
let name = name.as_ref().into();
|
||||
let name = Arc::new(RwLock::new(name.as_ref().into()));
|
||||
let clips = clips.as_ref().iter().map(|x|x.clone()).collect();
|
||||
Self { name, clips, }
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ impl Scene {
|
|||
|
||||
pub fn scene_name_max_len (scenes: &[Scene]) -> usize {
|
||||
scenes.iter()
|
||||
.map(|s|s.name.len())
|
||||
.map(|s|s.name.read().unwrap().len())
|
||||
.fold(0, usize::max)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue