@ -21,9 +21,8 @@ ConfigureAudio::ConfigureAudio(QWidget* parent)
ui - > output_sink_combo_box - > addItem ( sink_detail . id ) ;
ui - > output_sink_combo_box - > addItem ( sink_detail . id ) ;
}
}
connect ( ui - > volume_slider , & QSlider : : valueChanged , [ this ] {
connect ( ui - > volume_slider , & QSlider : : valueChanged , this ,
ui - > volume_indicator - > setText ( tr ( " %1 % " ) . arg ( ui - > volume_slider - > sliderPosition ( ) ) ) ;
& ConfigureAudio : : setVolumeIndicatorText ) ;
} ) ;
this - > setConfiguration ( ) ;
this - > setConfiguration ( ) ;
connect ( ui - > output_sink_combo_box ,
connect ( ui - > output_sink_combo_box ,
@ -62,7 +61,11 @@ void ConfigureAudio::setConfiguration() {
ui - > audio_device_combo_box - > setCurrentIndex ( new_device_index ) ;
ui - > audio_device_combo_box - > setCurrentIndex ( new_device_index ) ;
ui - > volume_slider - > setValue ( Settings : : values . volume * ui - > volume_slider - > maximum ( ) ) ;
ui - > volume_slider - > setValue ( Settings : : values . volume * ui - > volume_slider - > maximum ( ) ) ;
ui - > volume_indicator - > setText ( tr ( " %1 % " ) . arg ( ui - > volume_slider - > sliderPosition ( ) ) ) ;
setVolumeIndicatorText ( ui - > volume_slider - > sliderPosition ( ) ) ;
}
void ConfigureAudio : : setVolumeIndicatorText ( int percentage ) {
ui - > volume_indicator - > setText ( tr ( " %1% " , " Volume percentage (e.g. 50%) " ) . arg ( percentage ) ) ;
}
}
void ConfigureAudio : : applyConfiguration ( ) {
void ConfigureAudio : : applyConfiguration ( ) {