Example #1
0
        internal void UpdateAudioButtons()
        {
            AudioRoute availAudioRoutes  = AudioRoute.None;
            AudioRoute currentAudioRoute = AudioRoute.None;
            SipAVCall  avCall            = null;

            SipService sipService = BackgroundProcessController.Instance.SipService;

            if (sipService != null)
            {
                avCall = sipService.SipActiveAVCall;
                if (avCall != null)
                {
                    availAudioRoutes  = sipService.AvailableAudioRoutes;
                    currentAudioRoute = sipService.AudioRoute;
                }
            }

            IsEarpieceButtonEnabled  = ((availAudioRoutes & AudioRoute.Earpiece) != AudioRoute.None);
            IsSpeakerButtonEnabled   = ((availAudioRoutes & AudioRoute.Speakerphone) != AudioRoute.None);
            IsBluetoothButtonEnabled = ((availAudioRoutes & AudioRoute.Bluetooth) != AudioRoute.None);
            EarpieceButtonBorder     = (currentAudioRoute == AudioRoute.Earpiece) ? accentBrush : borderBrush;
            SpeakerButtonBorder      = (currentAudioRoute == AudioRoute.Speakerphone) ? accentBrush : borderBrush;
            BluetoothButtonBorder    = (currentAudioRoute == AudioRoute.Bluetooth) ? accentBrush : borderBrush;
        }
 public void OnAudioRoutingChanged(AudioRoute newRoute)
 {
     if (onAudioRoutingChanged != null)
     {
         onAudioRoutingChanged(this, new AudioRoutingEventArgs(newRoute));
     }
 }
Example #3
0
        public void SetAudioRoute(AudioRoute newRoute)
        {
            SipService sipService = BackgroundProcessController.Instance.SipService;


            if (sipService != null && newRoute != sipService.AudioRoute)
            {
                sipService.AudioRoute = newRoute;

                // Disable all audio route buttons, so the user doesn't press them again and again.
                // The buttons will get re-enabled if required when the audio route changes.
                DisableAllAudioRouteButtons();
            }
        }
Example #4
0
 internal AudioRoutingEventArgs(AudioRoute route)
 {
     mRoute = route;
 }
Example #5
0
 public void OnAudioRoutingChanged(AudioRoute newRoute)
 {
     if (onAudioRoutingChanged != null)
     {
         onAudioRoutingChanged(this, new AudioRoutingEventArgs(newRoute));
     }
 }
 internal AudioRoutingEventArgs(AudioRoute route)
 {
     mRoute = route;
 }
Example #7
0
        public void SetAudioRoute(AudioRoute newRoute)
        {
            SipService sipService = BackgroundProcessController.Instance.SipService;

            if (sipService != null && newRoute != sipService.AudioRoute)
            {
                sipService.AudioRoute = newRoute;

                // Disable all audio route buttons, so the user doesn't press them again and again.
                // The buttons will get re-enabled if required when the audio route changes.
                DisableAllAudioRouteButtons();
            }
        }