19#ifndef DRUMSTICK_ALSACLIENT_H
20#define DRUMSTICK_ALSACLIENT_H
25#include <QReadWriteLock>
40class SequencerInputThread;
61 int getSizeOfInfo()
const;
64 snd_seq_client_type_t getClientType();
66 bool getBroadcastFilter();
67 bool getErrorBounce();
70 void setClient(
int client);
71 void setName(QString name);
72 void setBroadcastFilter(
bool val);
73 void setErrorBounce(
bool val);
76#if SND_LIB_VERSION > 0x010010
77 void addFilter(
int eventType);
78 bool isFiltered(
int eventType);
80 void removeFilter(
int eventType);
87 const unsigned char* getEventFilter() __attribute__((deprecated));
88 void setEventFilter(
unsigned char* filter) __attribute__((deprecated));
91 snd_seq_client_info_t* m_Info;
118 int getSizeOfInfo()
const;
123 int getMaxChannels();
124 int getCurrentQueues();
125 int getCurrentClients();
128 snd_seq_system_info_t* m_Info;
144 PoolInfo(snd_seq_client_pool_t* other);
149 int getSizeOfInfo()
const;
157 void setInputPool(
int size);
158 void setOutputPool(
int size);
159 void setOutputRoom(
int size);
162 snd_seq_client_pool_t* m_Info;
204 void open(
const QString deviceName =
"default",
205 const int openMode = SND_SEQ_OPEN_DUPLEX,
206 const bool blockMode =
false );
207 void open( snd_config_t* conf,
208 const QString deviceName =
"default",
209 const int openMode = SND_SEQ_OPEN_DUPLEX,
210 const bool blockMode =
false );
212 void startSequencerInput();
213 void stopSequencerInput();
216 MidiQueue* createQueue(QString
const& name);
219 MidiQueue* useQueue(
const QString& name);
223 void detachAllPorts();
224 void addEventFilter(
int evtype);
225 void output(
SequencerEvent* ev,
bool async =
false,
int timeout = -1);
226 void outputDirect(
SequencerEvent* ev,
bool async =
false,
int timeout = -1);
228 void drainOutput(
bool async =
false,
int timeout = -1);
229 void synchronizeOutput();
232 snd_seq_type_t getSequencerType();
233 snd_seq_t* getHandle();
236 size_t getOutputBufferSize();
237 void setOutputBufferSize(
size_t newSize);
238 size_t getInputBufferSize();
239 void setInputBufferSize(
size_t newSize);
240 QString getDeviceName();
243 void setBlockMode(
bool newValue);
244 QString getClientName();
245 QString getClientName(
const int clientId);
246 void setClientName(QString
const& newName);
247 bool getBroadcastFilter();
248 void setBroadcastFilter(
bool newValue);
249 bool getErrorBounce();
250 void setErrorBounce(
bool newValue);
253 void setThisClientInfo(
const ClientInfo& val);
259 QList<int> getAvailableQueues();
262 void setPoolInfo(
const PoolInfo& info);
263 void setPoolInput(
int size);
264 void setPoolOutput(
int size);
265 void setPoolOutputRoom(
int size);
266 void resetPoolInput();
267 void resetPoolOutput();
269 void dropInputBuffer();
271 void dropOutputBuffer();
275 int inputPending(
bool fetch);
276 int getQueueId(
const QString& name);
278 void addListener(
QObject* listener);
279 void removeListener(
QObject* listener);
280 void setEventsEnabled(
const bool bEnabled);
281 bool getEventsEnabled()
const;
283 bool parseAddress(
const QString& straddr, snd_seq_addr& result );
284 void setRealTimeInput(
bool enabled);
285 bool realTimeInputEnabled();
293 void applyClientInfo();
296 void updateAvailablePorts();
300 const char * _getDeviceName();
301 int getPollDescriptorsCount(
short events);
302 int pollDescriptors(
struct pollfd *pfds,
unsigned int space,
short events);
303 unsigned short pollDescriptorsRevents(
struct pollfd *pfds,
unsigned int nfds);
306 void _setClientName(
const char *name );
307 int createSimplePort(
const char *name,
310 void deleteSimplePort(
int port );
311 void connectFrom(
int myport,
int client,
int port);
312 void connectTo(
int myport,
int client,
int port);
313 void disconnectFrom(
int myport,
int client,
int port);
314 void disconnectTo(
int myport,
int client,
int port);
318 class MidiClientPrivate;
319 MidiClientPrivate *d;
322#if SND_LIB_VERSION > 0x010004
323DRUMSTICK_EXPORT QString getRuntimeALSALibraryVersion();
324DRUMSTICK_EXPORT
int getRuntimeALSALibraryNumber();
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.
Classes managing ALSA Sequencer ports.
QList< MidiPort * > MidiPortList
List of Ports instances.
QList< PortInfo > PortInfoList
List of port information objects.
The QObject class is the base class of all Qt objects.
void eventReceived(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()
Destructor.
virtual void handleSequencerEvent(SequencerEvent *ev)=0
Callback function to be implemented by the derived class.
Base class for the event's hierarchy.