Пример #1
0
 /// <summary>
 ///     Deletes the registration of a client's
 ///     notification callback interface that the client registered in a previous call to the
 ///     <see cref="RegisterControlChangeNotify" /> method.
 /// </summary>
 /// <param name="notify">
 ///     The callback instance to unregister. The client passed this same object to the endpoint volume
 ///     object in the previous call to the <see cref="RegisterControlChangeNotify" /> method.
 /// </param>
 public void UnregisterControlChangeNotify(IAudioEndpointVolumeCallback notify)
 {
     if (notify == null)
     {
         throw new ArgumentNullException("notify");
     }
     CoreAudioAPIException.Try(UnregisterControlChangeNotifyNative(notify), C, "UnregisterControlChangeNotify");
 }
Пример #2
0
        /// <summary>
        /// The RegisterControlChangeNotify method registers a client's notification callback
        /// interface.
        /// </summary>
        /// <param name="notify">Notificationprovider</param>
        /// <returns>HRESULT</returns>
        /// <remarks>
        /// When notifications are no longer needed, the client can call the
        /// IAudioEndpointVolume::UnregisterControlChangeNotify method to terminate the
        /// notifications.
        /// </remarks>
        public unsafe int RegisterControlChangeNotifyNative(IAudioEndpointVolumeCallback notify)
        {
            int result = 0;

            if (!_notifies.Contains(notify))
            {
                result = InteropCalls.CallI(_basePtr, Marshal.GetComInterfaceForObject(notify, typeof(IAudioEndpointVolumeCallback)), ((void **)(*(void **)_basePtr))[3]);
                _notifies.Add(notify);
            }
            return(result);
        }
Пример #3
0
        /// <summary>
        ///     Deletes the registration of a client's
        ///     notification callback interface that the client registered in a previous call to the
        ///     <see cref="RegisterControlChangeNotify" /> method.
        /// </summary>
        /// <param name="notify">
        ///     The callback instance to unregister. The client passed this same object to the endpoint volume
        ///     object in the previous call to the <see cref="RegisterControlChangeNotify" /> method.
        /// </param>
        /// <returns>HRESULT</returns>
        public unsafe int UnregisterControlChangeNotifyNative(IAudioEndpointVolumeCallback notify)
        {
            int result = 0;

            if (_notifies.Contains(notify))
            {
                var ptr = Marshal.GetComInterfaceForObject(notify, typeof(IAudioEndpointVolumeCallback));
                try
                {
                    result = LocalInterop.Calli(UnsafeBasePtr, ptr, ((void **)(*(void **)UnsafeBasePtr))[4]);
                }
                finally
                {
                    Marshal.Release(ptr);
                }
                _notifies.Remove(notify);
            }
            return(result);
        }
Пример #4
0
 internal static unsafe int Calli(void *_basePtr, IAudioEndpointVolumeCallback notify, void *p)
 {
     throw new NotImplementedException();
 }
Пример #5
0
 internal static unsafe int CallI(void* _basePtr, IAudioEndpointVolumeCallback notify, void* p)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 /// <summary>
 /// The UnregisterControlChangeNotify method deletes the registration of a client's
 /// notification callback interface that the client registered in a previous call to the
 /// IAudioEndpointVolume::RegisterControlChangeNotify method.
 /// </summary>
 /// <param name="notify">Notificationprovider</param>
 public void UnregisterControlChangeNotify(IAudioEndpointVolumeCallback notify)
 {
     CoreAudioAPIException.Try(UnregisterControlChangeNotifyNative(notify), c, "UnregisterControlChangeNotify");
 }
Пример #7
0
 /// <summary>
 ///     Deletes the registration of a client's
 ///     notification callback interface that the client registered in a previous call to the
 ///     <see cref="RegisterControlChangeNotify" /> method.
 /// </summary>
 /// <param name="notify">
 ///     The callback instance to unregister. The client passed this same object to the endpoint volume
 ///     object in the previous call to the <see cref="RegisterControlChangeNotify" /> method.
 /// </param>
 /// <returns>HRESULT</returns>
 public unsafe int UnregisterControlChangeNotifyNative(IAudioEndpointVolumeCallback notify)
 {
     int result = 0;
     if (_notifies.Contains(notify))
     {
         result = InteropCalls.CallI(UnsafeBasePtr,
             Marshal.GetComInterfaceForObject(notify, typeof (IAudioEndpointVolumeCallback)),
             ((void**) (*(void**) UnsafeBasePtr))[4]);
         _notifies.Remove(notify);
     }
     return result;
 }
Пример #8
0
 /// <summary>
 ///     Deletes the registration of a client's
 ///     notification callback interface that the client registered in a previous call to the
 ///     <see cref="RegisterControlChangeNotify" /> method.
 /// </summary>
 /// <param name="notify">
 ///     The callback instance to unregister. The client passed this same object to the endpoint volume
 ///     object in the previous call to the <see cref="RegisterControlChangeNotify" /> method.
 /// </param>
 public void UnregisterControlChangeNotify(IAudioEndpointVolumeCallback notify)
 {
     CoreAudioAPIException.Try(UnregisterControlChangeNotifyNative(notify), C, "UnregisterControlChangeNotify");
 }
Пример #9
0
 /// <summary>
 ///     Deletes the registration of a client's
 ///     notification callback interface that the client registered in a previous call to the
 ///     <see cref="RegisterControlChangeNotify" /> method.
 /// </summary>
 /// <param name="notify">
 ///     The callback instance to unregister. The client passed this same object to the endpoint volume
 ///     object in the previous call to the <see cref="RegisterControlChangeNotify" /> method.
 /// </param>
 public void UnregisterControlChangeNotify(IAudioEndpointVolumeCallback notify)
 {
     if (notify == null)
         throw new ArgumentNullException("notify");
     CoreAudioAPIException.Try(UnregisterControlChangeNotifyNative(notify), C, "UnregisterControlChangeNotify");
 }
Пример #10
0
 /// <summary>
 ///     Registers a client's notification callback
 ///     interface.
 /// </summary>
 /// <param name="notify">The callback instance that the client is registering for notification callbacks.</param>
 /// <returns>HRESULT</returns>
 /// <remarks>
 ///     When notifications are no longer needed, the client can call the
 ///     <see cref="UnregisterControlChangeNotify" /> method to terminate the
 ///     notifications.
 /// </remarks>
 public unsafe int RegisterControlChangeNotifyNative(IAudioEndpointVolumeCallback notify)
 {
     int result = 0;
     if (!_notifies.Contains(notify))
     {
         var ptr = Marshal.GetComInterfaceForObject(notify, typeof (IAudioEndpointVolumeCallback));
         try
         {
             result = InteropCalls.CallI(UnsafeBasePtr, ptr, ((void**) (*(void**) UnsafeBasePtr))[3]);
         }
         finally
         {
             Marshal.Release(ptr);
         }
         _notifies.Add(notify);
     }
     return result;
 }