pub struct AmpConfigDto {
pub master_volume: f32,
pub is_active: bool,
pub channels: Vec<ChannelDto>,
pub current_channel: u32,
}Expand description
Represents the complete amplifier configuration state.
This DTO is serialized to JSON and sent to the frontend to display the current settings of the amplifier, including gain, master volume, and active/inactive status.
Fields§
§master_volume: f32The current master volume level.
is_active: boolWhether the audio loopback is currently active.
channels: Vec<ChannelDto>The list of all channels with their respective settings (gain, tone stack, volume).
current_channel: u32The current channel id
Implementations§
Source§impl AmpConfigDto
impl AmpConfigDto
Sourcepub fn from_service(service: &AudioService) -> Self
pub fn from_service(service: &AudioService) -> Self
Constructs an AmpConfigDto from the current state of an AudioService.
Reads atomic values from the service’s channel and master volume with relaxed memory ordering.
§Arguments
service- TheAudioServiceto snapshot.
Trait Implementations§
Source§impl Clone for AmpConfigDto
impl Clone for AmpConfigDto
Source§fn clone(&self) -> AmpConfigDto
fn clone(&self) -> AmpConfigDto
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AmpConfigDto
impl Debug for AmpConfigDto
Source§impl<'de> Deserialize<'de> for AmpConfigDto
impl<'de> Deserialize<'de> for AmpConfigDto
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AmpConfigDto
impl RefUnwindSafe for AmpConfigDto
impl Send for AmpConfigDto
impl Sync for AmpConfigDto
impl Unpin for AmpConfigDto
impl UnsafeUnpin for AmpConfigDto
impl UnwindSafe for AmpConfigDto
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more