fix renaming of duplicates; remove Arranger::modal

This commit is contained in:
🪞👃🪞 2024-10-11 16:19:06 +03:00
parent de4797ab52
commit f500c717a2
5 changed files with 44 additions and 140 deletions

View file

@ -40,7 +40,7 @@ pub enum PhrasePoolMode { Rename(usize, String) }
pub struct Phrase {
pub uuid: uuid::Uuid,
/// Name of phrase
pub name: Arc<RwLock<String>>,
pub name: String,
/// Temporal resolution in pulses per quarter note
pub ppq: usize,
/// Length of phrase in pulses
@ -174,7 +174,7 @@ pub fn random_color () -> Color {
}
impl Phrase {
pub fn new (
name: &str,
name: impl AsRef<str>,
loop_on: bool,
length: usize,
notes: Option<PhraseData>,
@ -182,7 +182,7 @@ impl Phrase {
) -> Self {
Self {
uuid: uuid::Uuid::new_v4(),
name: Arc::new(RwLock::new(name.into())),
name: name.as_ref().to_string(),
ppq: PPQ,
length,
notes: notes.unwrap_or(vec![Vec::with_capacity(16);length]),