示例#1
0
 protected virtual void OnVolumeChanged(VolumeChangedEventArgs e)
 {
     if (VolumeChanged != null)
     {
         VolumeChanged(this, e);
     }
 }
示例#2
0
        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);
                }
            }
        }
示例#3
0
        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);
            }
        }
示例#4
0
        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);
        }
示例#5
0
 void raop_VolumeChanged(object sender, VolumeChangedEventArgs e)
 {
     OnVolumeChanged(e);
 }