コード例 #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
ファイル: InteropCalls.cs プロジェクト: superowner/AudioSharp
 internal static unsafe int Calli(void *_basePtr, IAudioEndpointVolumeCallback notify, void *p)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
ファイル: InteropCalls.cs プロジェクト: hoangduit/cscore
 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
ファイル: AudioEndpointVolume.cs プロジェクト: opcon/cscore
 /// <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
ファイル: AudioEndpointVolume.cs プロジェクト: opcon/cscore
 /// <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;
 }