Example #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="AudioClock2" /> class.
        /// </summary>
        /// <param name="audioClock">
        ///     An <see cref="AudioClock" /> instance which should be used to query the
        ///     <see cref="AudioClock2" /> object.
        /// </param>
        /// <exception cref="ArgumentNullException">The <paramref name="audioClock" /> argument is null.</exception>
        /// <exception cref="NotSupportedException">
        ///     The <see cref="AudioClock2" /> COM object is not supported on the current platform. Only supported on Windows
        ///     7/Windows Server 2008 R2 and above.
        ///     For more information, see
        ///     <see href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd370883(v=vs.85).aspx" />.
        /// </exception>
        public AudioClock2(AudioClock audioClock)
        {
            if (audioClock == null)
                throw new ArgumentNullException("audioClock");

            IntPtr ptr = audioClock.QueryInterface(typeof (AudioClock2));
            if (ptr == null)
                throw new NotSupportedException("The IAudioClock2 COM object is not supported on current platform.");
            BasePtr = ptr;
        }
Example #2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="AudioClock2" /> class.
        /// </summary>
        /// <param name="audioClock">
        ///     An <see cref="AudioClock" /> instance which should be used to query the
        ///     <see cref="AudioClock2" /> object.
        /// </param>
        /// <exception cref="ArgumentNullException">The <paramref name="audioClock" /> argument is null.</exception>
        /// <exception cref="NotSupportedException">
        ///     The <see cref="AudioClock2" /> COM object is not supported on the current platform. Only supported on Windows
        ///     7/Windows Server 2008 R2 and above.
        ///     For more information, see
        ///     <see href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd370883(v=vs.85).aspx" />.
        /// </exception>
        public AudioClock2(AudioClock audioClock)
        {
            if (audioClock == null)
            {
                throw new ArgumentNullException("audioClock");
            }

            IntPtr ptr = audioClock.QueryInterface(typeof(AudioClock2));

            if (ptr == null)
            {
                throw new NotSupportedException("The IAudioClock2 COM object is not supported on current platform.");
            }
            BasePtr = ptr;
        }