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)); } }
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(); } }
internal AudioRoutingEventArgs(AudioRoute route) { mRoute = route; }