19#ifndef DRUMSTICK_ALSACLIENT_H
20#define DRUMSTICK_ALSACLIENT_H
24#include <QScopedPointer>
26#include <QReadWriteLock>
67 explicit ClientInfo(snd_seq_client_info_t *other);
72 int getSizeOfInfo()
const;
75 snd_seq_client_type_t getClientType();
77 bool getBroadcastFilter();
78 bool getErrorBounce();
81 void setClient(
int client);
82 void setName(QString name);
83 void setBroadcastFilter(
bool val);
84 void setErrorBounce(
bool val);
87#if SND_LIB_VERSION > 0x010010
88 void addFilter(
int eventType);
89 bool isFiltered(
int eventType);
91 void removeFilter(
int eventType);
98 Q_DECL_DEPRECATED
const unsigned char* getEventFilter();
99 Q_DECL_DEPRECATED
void setEventFilter(
unsigned char* filter);
102 snd_seq_client_info_t* m_Info;
124 explicit SystemInfo(snd_seq_system_info_t* other);
129 int getSizeOfInfo()
const;
134 int getMaxChannels();
135 int getCurrentQueues();
136 int getCurrentClients();
139 snd_seq_system_info_t* m_Info;
155 explicit PoolInfo(snd_seq_client_pool_t* other);
160 int getSizeOfInfo()
const;
168 void setInputPool(
int size);
169 void setOutputPool(
int size);
170 void setOutputRoom(
int size);
173 snd_seq_client_pool_t* m_Info;
215 void open(
const QString deviceName =
"default",
216 const int openMode = SND_SEQ_OPEN_DUPLEX,
217 const bool blockMode =
false );
218 void open( snd_config_t* conf,
219 const QString deviceName =
"default",
220 const int openMode = SND_SEQ_OPEN_DUPLEX,
221 const bool blockMode =
false );
223 void startSequencerInput();
224 void stopSequencerInput();
227 MidiQueue* createQueue(QString
const& name);
230 MidiQueue* useQueue(
const QString& name);
234 void detachAllPorts();
235 void addEventFilter(
int evtype);
236 void output(
SequencerEvent* ev,
bool async =
false,
int timeout = -1);
237 void outputDirect(
SequencerEvent* ev,
bool async =
false,
int timeout = -1);
239 void drainOutput(
bool async =
false,
int timeout = -1);
240 void synchronizeOutput();
243 snd_seq_type_t getSequencerType();
244 snd_seq_t* getHandle();
247 size_t getOutputBufferSize();
248 void setOutputBufferSize(
size_t newSize);
249 size_t getInputBufferSize();
250 void setInputBufferSize(
size_t newSize);
251 QString getDeviceName();
254 void setBlockMode(
bool newValue);
255 QString getClientName();
256 QString getClientName(
const int clientId);
257 void setClientName(QString
const& newName);
258 bool getBroadcastFilter();
259 void setBroadcastFilter(
bool newValue);
260 bool getErrorBounce();
261 void setErrorBounce(
bool newValue);
264 void setThisClientInfo(
const ClientInfo& val);
270 QList<int> getAvailableQueues();
273 void setPoolInfo(
const PoolInfo& info);
274 void setPoolInput(
int size);
275 void setPoolOutput(
int size);
276 void setPoolOutputRoom(
int size);
277 void resetPoolInput();
278 void resetPoolOutput();
280 void dropInputBuffer();
282 void dropOutputBuffer();
286 int inputPending(
bool fetch);
287 int getQueueId(
const QString& name);
289 void addListener(
QObject* listener);
290 void removeListener(
QObject* listener);
291 void setEventsEnabled(
const bool bEnabled);
292 bool getEventsEnabled()
const;
294 bool parseAddress(
const QString& straddr, snd_seq_addr& result );
295 void setRealTimeInput(
bool enabled);
296 bool realTimeInputEnabled();
306 void applyClientInfo();
309 void updateAvailablePorts();
313 const char * _getDeviceName();
314 int getPollDescriptorsCount(
short events);
315 int pollDescriptors(
struct pollfd *pfds,
unsigned int space,
short events);
316 unsigned short pollDescriptorsRevents(
struct pollfd *pfds,
unsigned int nfds);
319 void _setClientName(
const char *name );
320 int createSimplePort(
const char *name,
323 void deleteSimplePort(
int port );
324 void connectFrom(
int myport,
int client,
int port);
325 void connectTo(
int myport,
int client,
int port);
326 void disconnectFrom(
int myport,
int client,
int port);
327 void disconnectTo(
int myport,
int client,
int port);
331 class MidiClientPrivate;
332 QScopedPointer<MidiClientPrivate> d;
335#if SND_LIB_VERSION > 0x010004
336DRUMSTICK_EXPORT QString getRuntimeALSALibraryVersion();
337DRUMSTICK_EXPORT
int getRuntimeALSALibraryNumber();
Classes managing ALSA Sequencer ports.
The QObject class is the base class of all Qt objects.
void eventReceived(drumstick::ALSA::SequencerEvent *ev)
Signal emitted when an event is received.
Sequencer Pool information.
Auxiliary class to remove events from an ALSA queue.
Sequencer events handler.
virtual ~SequencerEventHandler()=default
Destructor.
virtual void handleSequencerEvent(SequencerEvent *ev)=0
Callback function to be implemented by the derived class.
Base class for the event's hierarchy.
int getRuntimeALSADriverNumber()
Gets the runtime ALSA drivers version number.
QString getRuntimeALSADriverVersion()
Gets the runtime ALSA drivers version string.
QList< ClientInfo > ClientInfoList
List of sequencer client information.
QString getDrumstickLibraryVersion()
getDrumstickLibraryVersion provides the Drumstick version as an edited QString
QString getCompiledALSALibraryVersion()
ALSA library version at build time.
QList< MidiPort * > MidiPortList
List of Ports instances.
QList< PortInfo > PortInfoList
List of port information objects.
Drumstick visibility macros.