Ejemplo n.º 1
0
        private void RegisterNotifications()
        {
            UnregisterNotifications();

            _audioSessionNotification = new AudioSessionNotification();
            Marshal.ThrowExceptionForHR(_audioSessionManager2.RegisterSessionNotification(_audioSessionNotification));
        }
Ejemplo n.º 2
0
        public void RefreshSessions()
        {
            UnregisterNotifications();

            Marshal.ThrowExceptionForHR(_AudioSessionManager2.GetSessionEnumerator(out IAudioSessionEnumerator _SessionEnum));
            _Sessions = new SessionCollection(_SessionEnum);

            _AudioSessionNotification = new AudioSessionNotification(this);
            Marshal.ThrowExceptionForHR(_AudioSessionManager2.RegisterSessionNotification(_AudioSessionNotification));
        }
Ejemplo n.º 3
0
        private void UnregisterNotifications()
        {
            if (_audioSessionNotification == null)
            {
                return;
            }

            Marshal.ThrowExceptionForHR(_audioSessionManager2.UnregisterSessionNotification(_audioSessionNotification));
            _audioSessionNotification = null;
        }
Ejemplo n.º 4
0
        public void RefreshSessions()
        {
            UnregisterNotifications();

            IAudioSessionEnumerator _SessionEnum;
            Marshal.ThrowExceptionForHR(_AudioSessionManager2.GetSessionEnumerator(out _SessionEnum));
            _Sessions = new SessionCollection(_SessionEnum);

            _AudioSessionNotification = new AudioSessionNotification(this);
            Marshal.ThrowExceptionForHR(_AudioSessionManager2.RegisterSessionNotification(_AudioSessionNotification));
        }