20 #ifndef DRUMSTICK_DRUMSTICKCOMMON_H
21 #define DRUMSTICK_DRUMSTICKCOMMON_H
26 #include <QApplication>
30 #include <alsa/asoundlib.h>
46 typedef quint8 MidiByte;
63 m_location(s), m_errCode(rc) {}
76 return QString(snd_strerror(m_errCode));
110 inline int checkErrorAndThrow(
int rc,
const char *where)
113 qDebug() <<
"Error code:" << rc <<
"(" << snd_strerror(rc) <<
")";
114 qDebug() <<
"Location:" << where;
115 throw SequencerError(QString(where), rc);
127 inline int checkWarning(
int rc,
const char *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);