/// <summary>
 /// Registers an even client for callbacks
 /// </summary>
 /// <param name="eventClient"></param>
 public void RegisterEventClient(IAudioSessionEventsHandler eventClient)
 {
     // we could have an array or list of listeners if we like
     audioSessionEventCallback = new AudioSessionEventsCallback(eventClient);
     Marshal.ThrowExceptionForHR(
         audioSessionControlInterface.RegisterAudioSessionNotification(audioSessionEventCallback));
 }
Example #2
0
 /// <summary>
 /// Dispose
 /// </summary>
 public void Dispose()
 {
     if (audioSessionEventCallback != null)
     {
         Marshal.ThrowExceptionForHR(audioSessionControlInterface.UnregisterAudioSessionNotification(audioSessionEventCallback));
         audioSessionEventCallback = null;
     }
     GC.SuppressFinalize(this);
 }
Example #3
0
 /// <summary>
 /// Unregisters an event client from receiving callbacks
 /// </summary>
 /// <param name="eventClient"></param>
 public void UnRegisterEventClient(IAudioSessionEventsHandler eventClient)
 {
     // if one is registered, let it go
     if (audioSessionEventCallback != null)
     {
         Marshal.ThrowExceptionForHR(audioSessionControlInterface.UnregisterAudioSessionNotification(audioSessionEventCallback));
         audioSessionEventCallback = null;
     }
 }
 /// <summary>
 /// Dispose
 /// </summary>
 public void Dispose()
 {
     if (audioSessionEventCallback != null)
     {
         Marshal.ThrowExceptionForHR(audioSessionControlInterface.UnregisterAudioSessionNotification(audioSessionEventCallback));
         audioSessionEventCallback = null;
     }
     GC.SuppressFinalize(this);
 }
Example #5
0
 /// <summary>
 /// Registers an even client for callbacks
 /// </summary>
 /// <param name="eventClient"></param>
 public void RegisterEventClient(IAudioSessionEventsHandler eventClient)
 {
     // we could have an array or list of listeners if we like
     audioSessionEventCallback = new AudioSessionEventsCallback(eventClient);
     Marshal.ThrowExceptionForHR(audioSessionControlInterface.RegisterAudioSessionNotification(audioSessionEventCallback));
 }
 /// <summary>
 /// Unregisters an event client from receiving callbacks
 /// </summary>
 /// <param name="eventClient"></param>
 public void UnRegisterEventClient(IAudioSessionEventsHandler eventClient)
 {
     // if one is registered, let it go
     if (audioSessionEventCallback != null)
     {
         Marshal.ThrowExceptionForHR(audioSessionControlInterface.UnregisterAudioSessionNotification(audioSessionEventCallback));
         audioSessionEventCallback = null;
     }
 }