Skip to main content

MasterVolume

Struct MasterVolume 

Source
pub struct MasterVolume(/* private fields */);
Expand description

Master volume and VIN panning (NR50).

BitFieldAccessMeaning
7vin_leftR/WMix external VIN into the left output.
6-4left_volumeR/WLeft output volume (0 treated as 1, 7 as 8).
3vin_rightR/WMix external VIN into the right output.
2-0right_volumeR/WRight output volume (0 treated as 1, 7 as 8).

Implementations§

Source§

impl MasterVolume

Source

pub const fn new() -> Self

Creates a new default initialized bitfield.

Source

pub const fn from_bits(bits: u8) -> Self

Convert from bits.

Source

pub const fn into_bits(self) -> u8

Convert into bits.

Source

pub const fn right_volume(&self) -> u8

Right output volume (0 is treated as 1, 7 as 8).

Bits: 0..3

Source

pub const fn with_right_volume_checked(self, value: u8) -> Result<Self, ()>

Right output volume (0 is treated as 1, 7 as 8).

Bits: 0..3

Source

pub const fn with_right_volume(self, value: u8) -> Self

Right output volume (0 is treated as 1, 7 as 8).

Bits: 0..3

Source

pub const fn set_right_volume(&mut self, value: u8)

Right output volume (0 is treated as 1, 7 as 8).

Bits: 0..3

Source

pub const fn set_right_volume_checked(&mut self, value: u8) -> Result<(), ()>

Right output volume (0 is treated as 1, 7 as 8).

Bits: 0..3

Source

pub const fn vin_right(&self) -> bool

Mix external VIN into the right output.

Bits: 3..4

Source

pub const fn with_vin_right_checked(self, value: bool) -> Result<Self, ()>

Mix external VIN into the right output.

Bits: 3..4

Source

pub const fn with_vin_right(self, value: bool) -> Self

Mix external VIN into the right output.

Bits: 3..4

Source

pub const fn set_vin_right(&mut self, value: bool)

Mix external VIN into the right output.

Bits: 3..4

Source

pub const fn set_vin_right_checked(&mut self, value: bool) -> Result<(), ()>

Mix external VIN into the right output.

Bits: 3..4

Source

pub const fn left_volume(&self) -> u8

Left output volume (0 is treated as 1, 7 as 8).

Bits: 4..7

Source

pub const fn with_left_volume_checked(self, value: u8) -> Result<Self, ()>

Left output volume (0 is treated as 1, 7 as 8).

Bits: 4..7

Source

pub const fn with_left_volume(self, value: u8) -> Self

Left output volume (0 is treated as 1, 7 as 8).

Bits: 4..7

Source

pub const fn set_left_volume(&mut self, value: u8)

Left output volume (0 is treated as 1, 7 as 8).

Bits: 4..7

Source

pub const fn set_left_volume_checked(&mut self, value: u8) -> Result<(), ()>

Left output volume (0 is treated as 1, 7 as 8).

Bits: 4..7

Source

pub const fn vin_left(&self) -> bool

Mix external VIN into the left output.

Bits: 7..8

Source

pub const fn with_vin_left_checked(self, value: bool) -> Result<Self, ()>

Mix external VIN into the left output.

Bits: 7..8

Source

pub const fn with_vin_left(self, value: bool) -> Self

Mix external VIN into the left output.

Bits: 7..8

Source

pub const fn set_vin_left(&mut self, value: bool)

Mix external VIN into the left output.

Bits: 7..8

Source

pub const fn set_vin_left_checked(&mut self, value: bool) -> Result<(), ()>

Mix external VIN into the left output.

Bits: 7..8

Trait Implementations§

Source§

impl Clone for MasterVolume

Source§

fn clone(&self) -> MasterVolume

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MasterVolume

Source§

impl Debug for MasterVolume

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MasterVolume

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for MasterVolume

Source§

impl From<MasterVolume> for u8

Source§

fn from(v: MasterVolume) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for MasterVolume

Source§

fn from(v: u8) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for MasterVolume

Source§

fn eq(&self, other: &MasterVolume) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MasterVolume

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CellValue for T
where T: Copy + BankSafe,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.