/// <summary>
        /// Instantiate the ASIO driver by GUID.
        /// </summary>
        /// <param name="guid">The GUID.</param>
        /// <returns>an AsioDriver instance</returns>
        public static MyAsioDriver GetAsioDriverByGuid(Guid guid)
        {
            var driver = new MyAsioDriver();

            driver.InitFromGuid(guid);
            return(driver);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MyAsioDriverExt"/> class based on an already
        /// instantiated AsioDriver instance.
        /// </summary>
        /// <param name="driver">A AsioDriver already instantiated.</param>
        public MyAsioDriverExt(MyAsioDriver driver)
        {
            this.driver = driver;

            if (!driver.Init(IntPtr.Zero))
            {
                throw new InvalidOperationException(driver.GetErrorMessage());
            }

            callbacks = new AsioCallbacks();
            callbacks.pasioMessage          = AsioMessageCallBack;
            callbacks.pbufferSwitch         = BufferSwitchCallBack;
            callbacks.pbufferSwitchTimeInfo = BufferSwitchTimeInfoCallBack;
            callbacks.psampleRateDidChange  = SampleRateDidChangeCallBack;

            BuildCapabilities();
        }