コード例 #1
0
ファイル: AudioClock.cs プロジェクト: hoangduit/cscore
        /// <summary>
        ///     Creates a new <see cref="AudioCaptureClient" /> by calling the <see cref="AudioClient.GetService" /> method of the
        ///     specified <paramref name="audioClient" />.
        /// </summary>
        /// <param name="audioClient">
        ///     <see cref="AudioClient" /> which should be used to create the <see cref="AudioCaptureClient" />-instance
        ///     with.
        /// </param>
        /// <returns>A new <see cref="AudioCaptureClient" />.</returns>
        public static AudioClock FromAudioClient(AudioClient audioClient)
        {
            if (audioClient == null)
                throw new ArgumentNullException("audioClient");

            return new AudioClock(audioClient.GetService(typeof (AudioClock).GUID));
        }
コード例 #2
0
        public static SimpleAudioVolume FromAudioClient(AudioClient audioClient)
        {
            if (audioClient == null)
                throw new ArgumentNullException("audioClient");

            return new SimpleAudioVolume(audioClient.GetService(IID_SimpleAudioVolume));
        }
コード例 #3
0
        /// <summary>
        ///     Creates a new <see cref="AudioCaptureClient" /> by calling the <see cref="AudioClient.GetService" /> method of the
        ///     specified <paramref name="audioClient" />.
        /// </summary>
        /// <param name="audioClient">
        ///     The <see cref="AudioClient" /> which should be used to create the <see cref="AudioCaptureClient" />-instance
        ///     with.
        /// </param>
        /// <returns>A new instance of the <see cref="AudioCaptureClient"/> class.</returns>
        public static AudioCaptureClient FromAudioClient(AudioClient audioClient)
        {
            if (audioClient == null)
                throw new ArgumentNullException("audioClient");

            return new AudioCaptureClient(audioClient.GetService(IID_IAudioCaptureClient));
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AudioSessionControl"/> class.
        /// </summary>
        /// <param name="audioClient">The audio client to create a <see cref="AudioSessionControl"/> instance for.</param>
        /// <exception cref="System.ArgumentNullException">audioClient</exception>
        public AudioSessionControl(AudioClient audioClient)
        {
            if (audioClient == null)
            {
                throw new ArgumentNullException("audioClient");
            }

            BasePtr = audioClient.GetService(typeof(AudioSessionControl).GUID);
        }
コード例 #5
0
        /// <summary>
        ///     Creates a new <see cref="AudioCaptureClient" /> by calling the <see cref="AudioClient.GetService" /> method of the
        ///     specified <paramref name="audioClient" />.
        /// </summary>
        /// <param name="audioClient">
        ///     <see cref="AudioClient" /> which should be used to create the <see cref="AudioCaptureClient" />-instance
        ///     with.
        /// </param>
        /// <returns>A new <see cref="AudioCaptureClient" />.</returns>
        public static AudioClock FromAudioClient(AudioClient audioClient)
        {
            if (audioClient == null)
            {
                throw new ArgumentNullException("audioClient");
            }

            return(new AudioClock(audioClient.GetService(typeof(AudioClock).GUID)));
        }
コード例 #6
0
        /// <summary>
        ///     Returns a new instance of the <see cref="AudioRenderClient" /> class. This is done by calling the
        ///     <see cref="AudioClient.GetService" /> method of the <see cref="AudioClient" /> class.
        /// </summary>
        /// <param name="audioClient">
        ///     The <see cref="AudioClient" /> instance which should be used to create the new
        ///     <see cref="AudioRenderClient" /> instance.
        /// </param>
        /// <returns>A new instance of the <see cref="AudioRenderClient" /> class.</returns>
        public static AudioRenderClient FromAudioClient(AudioClient audioClient)
        {
            if (audioClient == null)
            {
                throw new ArgumentNullException("audioClient");
            }

            return(new AudioRenderClient(audioClient.GetService(IID_IAudioRenderClient)));
        }
コード例 #7
0
        /// <summary>
        ///     Creates a new <see cref="SimpleAudioVolume" /> instance by calling the <see cref="AudioClient.GetService" /> method of the
        ///     specified <paramref name="audioClient" />.
        /// </summary>
        /// <param name="audioClient">
        ///     The <see cref="AudioClient" /> which should be used to create the <see cref="SimpleAudioVolume" />-instance
        ///     with.
        /// </param>
        /// <returns>A new instance of the <see cref="SimpleAudioVolume"/> class.</returns>
        public static SimpleAudioVolume FromAudioClient(AudioClient audioClient)
        {
            if (audioClient == null)
            {
                throw new ArgumentNullException("audioClient");
            }

            return(new SimpleAudioVolume(audioClient.GetService(IID_SimpleAudioVolume)));
        }
コード例 #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AudioSessionControl"/> class.
        /// </summary>
        /// <param name="audioClient">The audio client to create a <see cref="AudioSessionControl"/> instance for.</param>
        /// <exception cref="System.ArgumentNullException">audioClient</exception>
        public AudioSessionControl(AudioClient audioClient)
        {
            if (audioClient == null)
            {
                throw new ArgumentNullException("audioClient");
            }

            BasePtr = audioClient.GetService(typeof(AudioSessionControl).GUID);
            RegisterAudioSessionNotification(_sessionEvents);
        }