1 #ifndef HL_AUDIO_ERROR_H 2 #define HL_AUDIO_ERROR_H 7 #include "HulaVersion.h" 34 #define HL_PRINT_PREFIX "[HulaLoop] " 39 #define HL_ERROR_PREFIX "[HulaLoop] " 45 if (HL_NO_DEBUG_OUTPUT) {} \ 46 else std::cerr << HL_PRINT_PREFIX 51 #define hlDebugf(...) \ 52 if (HL_NO_DEBUG_OUTPUT) {} \ 53 else fprintf(stderr, HL_PRINT_PREFIX __VA_ARGS__); 62 #define HL_OS_INIT_CODE -1 63 #define HL_OS_INIT_MSG "Could not initialize OS audio module!" 65 #define HL_PA_INIT_CODE -2 66 #define HL_PA_INIT_MSG "Could not initialize Port Audio!" 68 #define HL_PA_GET_DEVICES_CODE -3 69 #define HL_PA_GET_DEVICES_MSG "Could not fetch Port Audio devices!" 71 #define HL_PA_OPEN_STREAM_CODE -4 72 #define HL_PA_OPEN_STREAM_MSG "Could not open Port Audio device stream!" 74 #define HL_PA_CLOSE_STREAM_CODE -5 75 #define HL_PA_CLOSE_STREAM_MSG "Could not close Port Audio device stream!" 77 #define HL_DEVICE_NOT_FOUND_CODE -6 78 #define HL_DEVICE_NOT_FOUND_MSG "Device not found!" 80 #define HL_CHECK_PARAMS_CODE -7 81 #define HL_CHECK_PARAMS_MSG "The specified sample rate or format is invalid!" 83 #define HL_PA_DEVICE_READ_STREAM_CODE -8 84 #define HL_PA_DEVICE_READ_STREAM_MSG "Error during read from device stream!" 87 #define HL_OSX_DAEMON_INIT_CODE -9 88 #define HL_OSX_DAEMON_INIT_MSG "Could not start hulaloop-osx-daemon process!" 90 #define HL_OSX_DAEMON_CRASH_CODE -10 91 #define HL_OSX_DAEMON_CRASH_MSG "The hulaloop-osx-daemon process crashed!" 93 #define HL_OSX_PGREP_CODE -11 94 #define HL_OSX_PGREP_MSG "Could not start pgrep process!" 96 #define HL_OSX_EXEPATH_CODE -12 97 #define HL_OSX_EXEPATH_MSG "Could not retrieve path to current executable!" 99 #define HL_OSX_EXEPATH_TRIM_CODE -13 100 #define HL_OSX_EXEPATH_TRIM_MSG "Could not trim executable name from install path!" 103 #define HL_LINUX_OPEN_DEVICE_CODE -14 104 #define HL_LINUX_OPEN_DEVICE_MSG "Could not open ALSA audio device!" 106 #define HL_LINUX_ALSA_CLOSE_STREAM_CODE -15 107 #define HL_LINUX_ALSA_CLOSE_STREAM_MSG "Could not close ALSA device stream!" 109 #define HL_LINUX_SET_PARAMS_CODE -16 110 #define HL_LINUX_SET_PARAMS_MSG "Could not set ALSA device params!" 113 #define HL_WIN_GET_DEVICES_CODE -17 114 #define HL_WIN_GET_DEVICES_MSG "Could not fetch WASAPI audio devices!" 116 #define HL_WIN_OPEN_STREAM_CODE -18 117 #define HL_WIN_OPEN_STREAM_MSG "Could not open WASAPI device stream!" 120 #define HL_RB_ALLOC_BUFFER_CODE -19 121 #define HL_RB_ALLOC_BUFFER_MSG "Could not allocate ring buffer!" 123 #define HL_RB_INIT_BUFFER_CODE -20 124 #define HL_RB_INIT_BUFFER_MSG "Could not initialize ring buffer! Perhaps the size is not power of 2?" 143 this->errorCode = errorCode;
169 #endif // END HL_AUDIO_ERROR_H const std::string getMessage() const
This method returns the error message that corresponds to the error code.
Definition: HulaAudioError.h:152
Exception class for the control module and higher.
Definition: HulaAudioError.h:131
Wrapper around translation functions for Qt.
Definition: Controller.h:10
int getErrorCode() const
This method returns the error code.
Definition: HulaAudioError.h:162
AudioException(int errorCode, const std::string &msg)
Constructor of AudioException.
Definition: HulaAudioError.h:141