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__))
Class used to report errors from the ALSA sequencer.
int code() const
Gets the numeric error code.
SequencerError(QString const &s, int rc)
Constructor.
const QString & location() const
Gets the location of the error code as provided in the constructor.
virtual ~SequencerError()
Destructor.
const QString qstrError() const
Gets the human readable error message from the error code.
const QString LIBRARY_VERSION(SND_LIB_VERSION_STR)
ALSA library version as a constant string.
int checkWarning(int rc, const char *where)
Check the error code for warning errors.
quint8 MidiByte
8-bit unsigned number to be used as a MIDI message parameter
int checkErrorAndThrow(int rc, const char *where)
Checks the error code for severe errors.
Drumstick visibility macros.