async fn play_media_volume_sound(
    sound_player_connection: Option<PlayerProxy>,
    priority_stream_playing: Arc<AtomicBool>,
    volume_level: Option<f32>,
    sound_player_added_files: Arc<Mutex<HashSet<&str>>>,
) {
    if let (Some(sound_player_proxy), Some(volume_level)) =
        (sound_player_connection.clone(), volume_level)
    {
        if priority_stream_playing.load(Ordering::SeqCst) {
            fx_log_info!("Detected a stream already playing, not playing earcons sound");
            return;
        }

        if volume_level >= 1.0 {
            play_sound(
                &sound_player_proxy,
                VOLUME_MAX_FILE_PATH,
                0,
                sound_player_added_files.clone(),
            )
            .await
            .ok();
        } else if volume_level > 0.0 {
            play_sound(
                &sound_player_proxy,
                VOLUME_CHANGED_FILE_PATH,
                1,
                sound_player_added_files.clone(),
            )
            .await
            .ok();
        }
    }
}
// Play the earcons sound given the changed volume streams.
Play the earcons sound given the changed volume streams.
Play the earcons sound given the changed volume streams .
async fn play_media_volume_sound(
    sound_player_connection: Option<PlayerProxy>,
    priority_stream_playing: Arc<AtomicBool>,
    volume_level: Option<f32>,
    sound_player_added_files: Arc<Mutex<HashSet<&str>>>,
) {
    if let (Some(sound_player_proxy), Some(volume_level)) =
        (sound_player_connection.clone(), volume_level)
    {
        if priority_stream_playing.load(Ordering::SeqCst) {
            fx_log_info!("Detected a stream already playing, not playing earcons sound");
            return;
        }
        if volume_level >= 1.0 {
            play_sound(
                &sound_player_proxy,
                VOLUME_MAX_FILE_PATH,
                0,
                sound_player_added_files.clone(),
            )
            .await
            .ok();
        } else if volume_level > 0.0 {
            play_sound(
                &sound_player_proxy,
                VOLUME_CHANGED_FILE_PATH,
                1,
                sound_player_added_files.clone(),
            )
            .await
            .ok();
        }
    }
}
async fn play_media_volume_sound ( sound_player_connection : Option < PlayerProxy > , priority_stream_playing : Arc < AtomicBool > , volume_level : Option < f32 > , sound_player_added_files : Arc < Mutex < HashSet < & str > > > , ) { if let ( Some ( sound_player_proxy ) , Some ( volume_level ) ) = ( sound_player_connection . clone ( ) , volume_level ) { if priority_stream_playing . load ( Ordering :: SeqCst ) { fx_log_info ! ( " " ) ; return ; } if volume_level >= 1.0 { play_sound ( & sound_player_proxy , VOLUME_MAX_FILE_PATH , 0 , sound_player_added_files . clone ( ) , ) . await . ok ( ) ; } else if volume_level > 0.0 { play_sound ( & sound_player_proxy , VOLUME_CHANGED_FILE_PATH , 1 , sound_player_added_files . clone ( ) , ) . await . ok ( ) ; } } }
Play the earcons sound given the changed volume streams.
Play the earcons sound given the changed volume streams .
sound_player_connection
Option<PlayerProxy>
priority_stream_playing
Arc<AtomicBool>
volume_level
Option<f32>
sound_player_added_files
Arc<Mutex<HashSet<&str>>>
sound_player_connection
Option<PlayerProxy>
priority_stream_playing
Arc<AtomicBool>
volume_level
Option<f32>
sound_player_added_files
Arc<Mutex<HashSet<&str>>>