Esempio n. 1
0
        private bool errorCheck(String action, PortAudio.PaError errorCode)
        {
            if (errorCode != PortAudio.PaError.paNoError)
            {
                CLog.LogError(action + " error: " + PortAudio.Pa_GetErrorText(errorCode));
                if (errorCode == PortAudio.PaError.paUnanticipatedHostError)
                {
                    PortAudio.PaHostErrorInfo errorInfo = PortAudio.Pa_GetLastHostErrorInfo();
                    CLog.LogError("- Host error API type: " + errorInfo.hostApiType);
                    CLog.LogError("- Host error code: " + errorInfo.errorCode);
                    CLog.LogError("- Host error text: " + errorInfo.errorText);
                }
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        /// <summary>
        ///     Checks if PA returned an error and logs it
        ///     Returns true on error
        /// </summary>
        /// <param name="action">Action identifier (E.g. openStream)</param>
        /// <param name="errorCode">Result returned by Pa_* call</param>
        /// <returns>True on error</returns>
        public bool CheckError(String action, PortAudio.PaError errorCode)
        {
            if (_Disposed)
            {
                throw new ObjectDisposedException("PortAudioHandle already disposed");
            }

            if (errorCode != PortAudio.PaError.paNoError)
            {
                CLog.LogError(action + " error: " + PortAudio.Pa_GetErrorText(errorCode));
                if (errorCode == PortAudio.PaError.paUnanticipatedHostError)
                {
                    PortAudio.PaHostErrorInfo errorInfo = PortAudio.Pa_GetLastHostErrorInfo();
                    CLog.LogError("- Host error API type: " + errorInfo.hostApiType);
                    CLog.LogError("- Host error code: " + errorInfo.errorCode);
                    CLog.LogError("- Host error text: " + errorInfo.errorText);
                }
                return(true);
            }

            return(false);
        }