fn do_calibration(&mut self) -> Result<Vec<CalibData>> {
        let mut zero_player: ZeroPlayer = Default::default();
        zero_player.start(Self::RDC_CALIB_WARM_UP_TIME)?;
        // Playback of zeros is started for Self::RDC_CALIB_WARM_UP_TIME, and the main thread
        // can start the calibration.
        let setting = &self.setting;
        let card = &mut self.card;
        let calib = setting
            .controls
            .iter()
            .map(|control| {
                card.control_by_name::<SwitchControl>(&control.calib_ctrl)?
                    .on()?;
                let rdc = card
                    .control_by_name::<IntControl>(&control.rdc_ctrl)?
                    .get()?;
                let temp = card
                    .control_by_name::<IntControl>(&control.temp_ctrl)?
                    .get()?;
                card.control_by_name::<SwitchControl>(&control.calib_ctrl)?
                    .off()?;
                Ok(CalibData {
                    rdc,
                    temp: Self::dsm_unit_to_celsius(temp),
                })
            })
            .collect::<Result<Vec<CalibData>>>()?;
        zero_player.stop()?;
        Ok(calib)
    }
/// Triggers the amplifier calibration and reads the calibrated rdc and ambient_temp value
/// from the mixer control.
/// To get accurate calibration results, the main thread calibrates the amplifier while
/// the `zero_player` starts another thread to play zeros to the speakers.
Triggers the amplifier calibration and reads the calibrated rdc and ambient_temp value
from the mixer control.
To get accurate calibration results, the main thread calibrates the amplifier while
the `zero_player` starts another thread to play zeros to the speakers.
Triggers the amplifier calibration and reads the calibrated rdc and ambient_temp value from the mixer control . To get accurate calibration results the main thread calibrates the amplifier while the ` zero_player ` starts another thread to play zeros to the speakers .
fn do_calibration(&mut self) -> Result<Vec<CalibData>> {
        let mut zero_player: ZeroPlayer = Default::default();
        zero_player.start(Self::RDC_CALIB_WARM_UP_TIME)?;
        // Playback of zeros is started for Self::RDC_CALIB_WARM_UP_TIME, and the main thread
        // can start the calibration.
        let setting = &self.setting;
        let card = &mut self.card;
        let calib = setting
            .controls
            .iter()
            .map(|control| {
                card.control_by_name::<SwitchControl>(&control.calib_ctrl)?
                    .on()?;
                let rdc = card
                    .control_by_name::<IntControl>(&control.rdc_ctrl)?
                    .get()?;
                let temp = card
                    .control_by_name::<IntControl>(&control.temp_ctrl)?
                    .get()?;
                card.control_by_name::<SwitchControl>(&control.calib_ctrl)?
                    .off()?;
                Ok(CalibData {
                    rdc,
                    temp: Self::dsm_unit_to_celsius(temp),
                })
            })
            .collect::<Result<Vec<CalibData>>>()?;
        zero_player.stop()?;
        Ok(calib)
    }
fn do_calibration ( & mut self ) -> Result < Vec < CalibData > > { let mut zero_player : ZeroPlayer = Default :: default ( ) ; zero_player . start ( Self :: RDC_CALIB_WARM_UP_TIME ) ? ; // Playback of zeros is started for Self::RDC_CALIB_WARM_UP_TIME, and the main thread // can start the calibration. let setting = & self . setting ; let card = & mut self . card ; let calib = setting . controls . iter ( ) . map ( | control | { card . control_by_name :: < SwitchControl > ( & control . calib_ctrl ) ? . on ( ) ? ; let rdc = card . control_by_name :: < IntControl > ( & control . rdc_ctrl ) ? . get ( ) ? ; let temp = card . control_by_name :: < IntControl > ( & control . temp_ctrl ) ? . get ( ) ? ; card . control_by_name :: < SwitchControl > ( & control . calib_ctrl ) ? . off ( ) ? ; Ok ( CalibData { rdc , temp : Self :: dsm_unit_to_celsius ( temp ) , } ) } ) . collect :: < Result < Vec < CalibData > > > ( ) ? ; zero_player . stop ( ) ? ; Ok ( calib ) }
Triggers the amplifier calibration and reads the calibrated rdc and ambient_temp value
from the mixer control.
Triggers the amplifier calibration and reads the calibrated rdc and ambient_temp value from the mixer control .
&mut self
&mut self