Skip to content

Commit

Permalink
#231 Add compartment and variable prefix to parameter labels
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Mar 23, 2021
1 parent c67f81e commit c373dcd
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions main/src/application/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,17 @@ impl Session {
&self.parameter_settings[compartment][index as usize]
}

pub fn get_parameter_name(&self, compartment: MappingCompartment, index: u32) -> String {
let setting = &self.parameter_settings[compartment][index as usize];
match &setting.custom_name {
None => format!("Parameter {}", index + 1),
pub fn get_parameter_name(&self, compartment: MappingCompartment, rel_index: u32) -> String {
let setting = &self.parameter_settings[compartment][rel_index as usize];
let suffix = match &setting.custom_name {
None => format!("Param {}", rel_index + 1),
Some(n) => n.clone(),
}
};
let compartment_label = match compartment {
MappingCompartment::ControllerMappings => "Ctrl",
MappingCompartment::MainMappings => "Main",
};
format!("{} p{} ({})", compartment_label, rel_index + 1, suffix)
}

pub fn set_parameter_settings_without_notification(
Expand Down

0 comments on commit c373dcd

Please sign in to comment.