Beispiel #1
0
        /// <summary>
        /// Gets a pointer to the audio session enumerator object.
        /// <seealso cref="RegisterDuckNotification"/>
        /// </summary>
        /// <param name="sessionEnumerator">Retrieves a session enumerator object that the client can use to enumerate audio sessions on the audio device.</param>
        /// <returns>HRESULT</returns>
        /// <remarks>The client is responsible for releasing the <paramref name="sessionEnumerator"/>.</remarks>
        public unsafe int GetSessionEnumeratorNative(out AudioSessionEnumerator sessionEnumerator)
        {
            IntPtr ptr    = IntPtr.Zero;
            int    result = InteropCalls.CallI(UnsafeBasePtr, &ptr, ((void **)(*(void **)UnsafeBasePtr))[5]);

            sessionEnumerator = ptr != IntPtr.Zero ? new AudioSessionEnumerator(ptr) : null;
            return(result);
        }
        /// <summary>
        /// The GetSessionEnumerator method gets a pointer to the audio session enumerator object.
        /// </summary>
        /// <returns>HRESULT</returns>
        public unsafe int GetSessionEnumeratorNative(out AudioSessionEnumerator sessionEnumerator)
        {
            IntPtr ptr    = IntPtr.Zero;
            int    result = InteropCalls.CallI(_basePtr, &ptr, ((void **)(*(void **)_basePtr))[5]);

            if (ptr != IntPtr.Zero)
            {
                sessionEnumerator = new AudioSessionEnumerator(ptr);
            }
            else
            {
                sessionEnumerator = null;
            }
            return(result);
        }