protected virtual void OnVolumeChanged(VolumeChangedEventArgs e) { if (VolumeChanged != null) { VolumeChanged(this, e); } }
void airtunesServer_VolumeChanged(object sender, ShairportSharp.Raop.VolumeChangedEventArgs e) { if (!allowVolumeControl) { return; } var context = getPlayerContext <AirplayAudioPlayer>(); if (context != null) { var pm = ServiceRegistration.Get <IPlayerManager>(); lock (volumeSync) { if (savedVolume == null) { savedVolume = pm.Volume; } } if (e.Volume < -30) { pm.Muted = true; } else { pm.Volume = (int)((e.Volume + 30) / 0.3); } } }
void server_VolumeChange(object sender, ShairportSharp.Raop.VolumeChangedEventArgs e) { if (InvokeRequired) { BeginInvoke((MethodInvoker) delegate() { server_VolumeChange(sender, e); }); return; } if (playerForm != null) { playerForm.SetVolume(e); } }
void airtunesServer_VolumeChanged(object sender, ShairportSharp.Raop.VolumeChangedEventArgs e) { invoke(delegate() { if (isAudioPlaying) { VolumeHandler volumeHandler = VolumeHandler.Instance; if (savedVolume == null) { savedVolume = volumeHandler.Volume; } if (e.Volume < -30) { volumeHandler.IsMuted = true; } else { double percent = (e.Volume + 30) / 30; volumeHandler.Volume = (int)(volumeHandler.Maximum * percent); } } }, false); }
void raop_VolumeChanged(object sender, VolumeChangedEventArgs e) { OnVolumeChanged(e); }