feat: decode meters clip indicators
This commit is contained in:
@@ -277,7 +277,7 @@ impl DSP408 {
|
||||
}
|
||||
|
||||
// Command `0x13` (Device Name)
|
||||
pub fn get_device_name(&mut self) -> Result<String, DSPError> {
|
||||
fn get_device_name(&mut self) -> Result<String, DSPError> {
|
||||
let request = commands::build_request_device_name();
|
||||
|
||||
let resp = self.send_recv(&request)?;
|
||||
@@ -292,7 +292,7 @@ impl DSP408 {
|
||||
}
|
||||
|
||||
// Command `0x14` (Current Preset Index)
|
||||
pub fn get_current_preset(&mut self) -> Result<u8, DSPError> {
|
||||
fn get_current_preset(&mut self) -> Result<u8, DSPError> {
|
||||
let request = commands::build_get_current_preset();
|
||||
|
||||
let resp = self.send_recv(&request)?;
|
||||
@@ -400,7 +400,7 @@ impl DSP408 {
|
||||
}
|
||||
|
||||
// Command `0x22` (Get Preset Modification Status)
|
||||
pub fn get_preset_modification_status(&mut self) -> Result<types::ModifiedPreset, DSPError> {
|
||||
fn get_preset_modification_status(&mut self) -> Result<types::ModifiedPreset, DSPError> {
|
||||
let request = commands::build_preset_modification_status();
|
||||
|
||||
let resp = self.send_recv(&request)?;
|
||||
@@ -447,8 +447,20 @@ impl DSP408 {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
let state = self.state_mut()?;
|
||||
let current_index = {
|
||||
let state = self.state()?;
|
||||
state.presets.current_index
|
||||
};
|
||||
|
||||
if !self.store_current_configuration(current_index, true)? {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
if !self.request_acknowledgement()? {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
let state = self.state_mut()?;
|
||||
state.presets.names[state.presets.current_index] = name.to_string();
|
||||
|
||||
Ok(true)
|
||||
@@ -478,7 +490,7 @@ impl DSP408 {
|
||||
}
|
||||
|
||||
// Command `0x29` (Preset Name)
|
||||
pub fn get_preset_name(&mut self, preset_index: usize) -> Result<String, DSPError> {
|
||||
fn get_preset_name(&mut self, preset_index: usize) -> Result<String, DSPError> {
|
||||
let raw_index = mapper::preset_index_without_factory_to_raw(preset_index)?;
|
||||
|
||||
let request = commands::build_get_preset_name(raw_index)?;
|
||||
@@ -516,7 +528,7 @@ impl DSP408 {
|
||||
}
|
||||
|
||||
// Command `0x2C` (Device Flags)
|
||||
pub fn get_device_flags(&mut self) -> Result<types::DeviceFlags, DSPError> {
|
||||
fn get_device_flags(&mut self) -> Result<types::DeviceFlags, DSPError> {
|
||||
let request = commands::build_get_device_flags();
|
||||
|
||||
let resp = self.send_recv(&request)?;
|
||||
|
||||
Reference in New Issue
Block a user