@@ -33,7 +33,7 @@ const SND_CTL_TLV_DB_GAIN_MUTE: MilliBel = MilliBel(-9999999);
33
33
const ZERO_DB : MilliBel = MilliBel ( 0 ) ;
34
34
35
35
#[ derive( Debug , Error ) ]
36
- enum AslaMixerError {
36
+ enum AlsaMixerError {
37
37
#[ error( "Could not open Alsa mixer. {0}" ) ]
38
38
CouldNotOpen ( AlsaError ) ,
39
39
#[ error( "Could not find Alsa mixer control" ) ]
@@ -48,8 +48,8 @@ enum AslaMixerError {
48
48
CouldNotConvertRaw ( AlsaError ) ,
49
49
}
50
50
51
- impl From < AslaMixerError > for Error {
52
- fn from ( value : AslaMixerError ) -> Self {
51
+ impl From < AlsaMixerError > for Error {
52
+ fn from ( value : AlsaMixerError ) -> Self {
53
53
Error :: failed_precondition ( value)
54
54
}
55
55
}
@@ -64,10 +64,10 @@ impl Mixer for AlsaMixer {
64
64
let mut config = config; // clone
65
65
66
66
let mixer =
67
- alsa:: mixer:: Mixer :: new ( & config. device , false ) . map_err ( AslaMixerError :: CouldNotOpen ) ?;
67
+ alsa:: mixer:: Mixer :: new ( & config. device , false ) . map_err ( AlsaMixerError :: CouldNotOpen ) ?;
68
68
let simple_element = mixer
69
69
. find_selem ( & SelemId :: new ( & config. control , config. index ) )
70
- . ok_or ( AslaMixerError :: CouldNotFindController ) ?;
70
+ . ok_or ( AlsaMixerError :: CouldNotFindController ) ?;
71
71
72
72
// Query capabilities
73
73
let has_switch = simple_element. has_playback_switch ( ) ;
@@ -83,16 +83,16 @@ impl Mixer for AlsaMixer {
83
83
// API for hardware and software mixers
84
84
let ( min_millibel, max_millibel) = if is_softvol {
85
85
let control =
86
- Ctl :: new ( & config. device , false ) . map_err ( AslaMixerError :: CouldNotOpenWithDevice ) ?;
86
+ Ctl :: new ( & config. device , false ) . map_err ( AlsaMixerError :: CouldNotOpenWithDevice ) ?;
87
87
let mut element_id = ElemId :: new ( ElemIface :: Mixer ) ;
88
88
element_id. set_name (
89
89
& CString :: new ( config. control . as_str ( ) )
90
- . map_err ( AslaMixerError :: CouldNotOpenWithName ) ?,
90
+ . map_err ( AlsaMixerError :: CouldNotOpenWithName ) ?,
91
91
) ;
92
92
element_id. set_index ( config. index ) ;
93
93
let ( min_millibel, mut max_millibel) = control
94
94
. get_db_range ( & element_id)
95
- . map_err ( AslaMixerError :: NoDbRange ) ?;
95
+ . map_err ( AlsaMixerError :: NoDbRange ) ?;
96
96
97
97
// Alsa can report incorrect maximum volumes due to rounding
98
98
// errors. e.g. Alsa rounds [-60.0..0.0] in range [0..255] to
@@ -122,7 +122,7 @@ impl Mixer for AlsaMixer {
122
122
debug ! ( "Alsa mixer reported minimum dB as mute, trying workaround" ) ;
123
123
min_millibel = simple_element
124
124
. ask_playback_vol_db ( min + 1 )
125
- . map_err ( AslaMixerError :: CouldNotConvertRaw ) ?;
125
+ . map_err ( AlsaMixerError :: CouldNotConvertRaw ) ?;
126
126
}
127
127
( min_millibel, max_millibel)
128
128
} ;
0 commit comments