Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ASIODriverExt"/> class based on an already
        /// instantiated ASIODriver instance.
        /// </summary>
        /// <param name="driver">A ASIODriver already instantiated.</param>
        public ASIODriverExt(ASIODriver 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();
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ASIODriverExt"/> class based on an already
        /// instantiated ASIODriver instance.
        /// </summary>
        /// <param name="driver">A ASIODriver already instantiated.</param>
        public ASIODriverExt(ASIODriver 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();
        }
Beispiel #3
0
 /// <summary>
 /// Creates the buffers.
 /// </summary>
 /// <param name="bufferInfos">The buffer infos.</param>
 /// <param name="numChannels">The num channels.</param>
 /// <param name="bufferSize">Size of the buffer.</param>
 /// <param name="callbacks">The callbacks.</param>
 public void createBuffers(IntPtr bufferInfos, int numChannels, int bufferSize, ref ASIOCallbacks callbacks)
 {
     // next two lines suggested by droidi on codeplex issue tracker
     pinnedcallbacks = Marshal.AllocHGlobal(Marshal.SizeOf(callbacks));
     Marshal.StructureToPtr(callbacks, pinnedcallbacks, false);
     handleException(asioDriverVTable.createBuffers(pASIOComObject, bufferInfos, numChannels, bufferSize, pinnedcallbacks), "createBuffers");
 }
Beispiel #4
0
 /// <summary>
 /// Creates the buffers.
 /// </summary>
 /// <param name="bufferInfos">The buffer infos.</param>
 /// <param name="numChannels">The num channels.</param>
 /// <param name="bufferSize">Size of the buffer.</param>
 /// <param name="callbacks">The callbacks.</param>
 public void createBuffers(IntPtr bufferInfos, int numChannels, int bufferSize, ref ASIOCallbacks callbacks)
 {
     // next two lines suggested by droidi on codeplex issue tracker
     pinnedcallbacks = Marshal.AllocHGlobal(Marshal.SizeOf(callbacks));
     Marshal.StructureToPtr(callbacks, pinnedcallbacks, false);
     handleException(asioDriverVTable.createBuffers(pASIOComObject, bufferInfos, numChannels, bufferSize, pinnedcallbacks), "createBuffers");
 }