20 #ifndef DRUMSTICK_DRUMSTICKCOMMON_H 21 #define DRUMSTICK_DRUMSTICKCOMMON_H 26 #include <QApplication> 30 #include <alsa/asoundlib.h> 63 m_location(s), m_errCode(rc) {}
76 return QString(snd_strerror(m_errCode));
113 qDebug() <<
"Error code:" << rc <<
"(" << snd_strerror(rc) <<
")";
114 qDebug() <<
"Location:" << where;
130 qWarning() <<
"Exception code:" << rc <<
"(" << snd_strerror(rc) <<
")";
131 qWarning() <<
"Location:" << where;
140 #define CHECK_ERROR(x) (checkErrorAndThrow((x),__PRETTY_FUNCTION__)) 146 #define CHECK_WARNING(x) (checkWarning((x),__PRETTY_FUNCTION__)) 155 const QString LIBRARY_VERSION(SND_LIB_VERSION_STR);
int code() const
Gets the numeric error code.
Drumstick visibility macros.
Class used to report errors from the ALSA sequencer.
int checkErrorAndThrow(int rc, const char *where)
Checks the error code for severe errors.
SequencerError(QString const &s, int rc)
Constructor.
int checkWarning(int rc, const char *where)
Check the error code for warning errors.
const QString & location() const
Gets the location of the error code as provided in the constructor.
const QString qstrError() const
Gets the human readable error message from the error code.
virtual ~SequencerError()
Destructor.
quint8 MidiByte
8-bit unsigned number to be used as a MIDI message parameter