Esempio n. 1
0
        public AsioError DisposeBuffers()
        {
            AsioError arg_21_0 = this.asioDriverVTable.disposeBuffers(this.pAsioComObject);

            Marshal.FreeHGlobal(this.pinnedcallbacks);
            return(arg_21_0);
        }
        /// <summary>
        /// Disposes the buffers.
        /// </summary>
        public AsioError DisposeBuffers()
        {
            AsioError result = asioDriverVTable.disposeBuffers(pAsioComObject);

            Marshal.FreeHGlobal(pinnedcallbacks);
            return(result);
        }
Esempio n. 3
0
 private void HandleException(AsioError error, string methodName)
 {
     if (error != AsioError.ASE_OK && error != AsioError.ASE_SUCCESS)
     {
         throw new AsioException(string.Format("Error code [{0}] while calling ASIO method <{1}>, {2}", AsioException.getErrorName(error), methodName, this.GetErrorMessage()))
               {
                   Error = error
               };
     }
 }
 /// <summary>
 /// Handles the exception. Throws an exception based on the error.
 /// </summary>
 /// <param name="error">The error to check.</param>
 /// <param name="methodName">Method name</param>
 private void HandleException(AsioError error, string methodName)
 {
     if (error != AsioError.ASE_OK && error != AsioError.ASE_SUCCESS)
     {
         var asioException = new AsioException(
             $"Error code [{AsioException.getErrorName(error)}] while calling ASIO method <{methodName}>, {this.GetErrorMessage()}");
         asioException.Error = error;
         throw asioException;
     }
 }
Esempio n. 5
0
        public bool CanSampleRate(double sampleRate)
        {
            AsioError asioError = this.asioDriverVTable.canSampleRate(this.pAsioComObject, sampleRate);

            if (asioError == AsioError.ASE_NoClock)
            {
                return(false);
            }
            if (asioError == AsioError.ASE_OK)
            {
                return(true);
            }
            this.HandleException(asioError, "canSampleRate");
            return(false);
        }
Esempio n. 6
0
 /// <summary>
 /// Gets the name of the error.
 /// </summary>
 /// <param name="error">The error.</param>
 /// <returns>the name of the error</returns>
 public static String getErrorName(AsioError error)
 {
     return(Enum.GetName(typeof(AsioError), error));
 }