drumstick 2.9.0
C++ MIDI libraries using Qt objects, idioms, and style.
ALSA Sequencer Clients

ALSA clients are any entities using ALSA sequencer services. More...

Classes

class  ClientInfo
 Client information. More...
 
class  SystemInfo
 System information. More...
 
class  PoolInfo
 Sequencer Pool information. More...
 
class  SequencerEventHandler
 Sequencer events handler. More...
 
class  MidiClient
 Client management. More...
 
class  MidiClient::SequencerInputThread
 This class manages event input from the ALSA sequencer. More...
 

Typedefs

typedef QList< ClientInfoClientInfoList
 List of sequencer client information.
 

Functions

QString getRuntimeALSADriverVersion ()
 Gets the runtime ALSA drivers version string. More...
 
int getRuntimeALSADriverNumber ()
 Gets the runtime ALSA drivers version number. More...
 
QString getCompiledALSALibraryVersion ()
 ALSA library version at build time. More...
 
QString getDrumstickLibraryVersion ()
 getDrumstickLibraryVersion provides the Drumstick version as an edited QString More...
 
 MidiClient (QObject *parent=nullptr)
 Constructor. More...
 
virtual ~MidiClient ()
 Destructor. More...
 
snd_seq_t * getHandle ()
 Returns the sequencer handler managed by ALSA. More...
 
bool isOpened ()
 Returns true if the sequencer is opened. More...
 
QString getDeviceName ()
 Returns the name of the sequencer device. More...
 
int getOpenMode ()
 Returns the last open mode used in open() More...
 
bool getBlockMode ()
 Returns the last block mode used in open() More...
 
bool getEventsEnabled () const
 Returns true if the events mode of delivery has been enabled. More...
 
void setHandler (SequencerEventHandler *handler)
 Sets a sequencer event handler enabling the callback delivery mode. More...
 
void setRealTimeInput (bool enabled)
 Enables real-time priority for the MIDI input thread. More...
 
bool realTimeInputEnabled ()
 Return the real-time priority setting for the MIDI input thread. More...
 
void open (const QString deviceName="default", const int openMode=SND_SEQ_OPEN_DUPLEX, const bool blockMode=false)
 Open the sequencer device. More...
 
void open (snd_config_t *conf, const QString deviceName="default", const int openMode=SND_SEQ_OPEN_DUPLEX, const bool blockMode=false)
 Open the sequencer device, providing a configuration object pointer. More...
 
void close ()
 Close the sequencer device. More...
 
size_t getOutputBufferSize ()
 Gets the size of the library output buffer for the ALSA client. More...
 
void setOutputBufferSize (size_t newSize)
 Sets the size of the library output buffer for the ALSA client. More...
 
size_t getInputBufferSize ()
 Gets the size of the library input buffer for the ALSA client. More...
 
void setInputBufferSize (size_t newSize)
 Sets the size of the library input buffer for the ALSA client. More...
 
void setBlockMode (bool newValue)
 Change the blocking mode of the client. More...
 
int getClientId ()
 Gets the client ID. More...
 
snd_seq_type_t getSequencerType ()
 Returns the type snd_seq_type_t of the given sequencer handle. More...
 
void doEvents ()
 Dispatch the events received from the Sequencer. More...
 
void startSequencerInput ()
 Starts reading events from the ALSA sequencer.
 
void stopSequencerInput ()
 Stops reading events from the ALSA sequencer.
 
void readClients ()
 Reads the ALSA sequencer's clients list.
 
void freeClients ()
 Releases the list of ALSA sequencer's clients.
 
ClientInfoList getAvailableClients ()
 Gets the list of clients from the ALSA sequencer. More...
 
ClientInfogetThisClientInfo ()
 Gets the ClientInfo object holding data about this client. More...
 
void setThisClientInfo (const ClientInfo &val)
 Sets the data supplied by the ClientInfo object into the ALSA sequencer client. More...
 
void applyClientInfo ()
 This internal method applies the ClientInfo data to the ALSA sequencer client.
 
QString getClientName ()
 Gets the client's public name. More...
 
QString getClientName (const int clientId)
 Gets the public name corresponding to the given Client ID. More...
 
void setClientName (QString const &newName)
 Changes the public name of the ALSA sequencer client. More...
 
MidiPortList getMidiPorts () const
 Gets the list of MidiPort instances belonging to this client. More...
 
MidiPortcreatePort ()
 Create and attach a new MidiPort instance to this client. More...
 
void portAttach (MidiPort *port)
 Attach a MidiPort instance to this client. More...
 
void portDetach (MidiPort *port)
 Detach a MidiPort instance from this client. More...
 
void detachAllPorts ()
 Detach all the ports belonging to this client.
 
void addEventFilter (int evtype)
 Add an event filter to the client. More...
 
bool getBroadcastFilter ()
 Gets the broadcast filter usage of the client. More...
 
void setBroadcastFilter (bool newValue)
 Sets the broadcast filter usage of the client. More...
 
bool getErrorBounce ()
 Get the error-bounce usage of the client. More...
 
void setErrorBounce (bool newValue)
 Sets the error-bounce usage of the client. More...
 
void output (SequencerEvent *ev, bool async=false, int timeout=-1)
 Output an event using the library output buffer. More...
 
void outputDirect (SequencerEvent *ev, bool async=false, int timeout=-1)
 Output an event directly to the sequencer. More...
 
void outputBuffer (SequencerEvent *ev)
 Output an event using the library output buffer, without draining the buffer. More...
 
void drainOutput (bool async=false, int timeout=-1)
 Drain the library output buffer. More...
 
void synchronizeOutput ()
 Wait until all sent events are processed. More...
 
MidiQueuegetQueue ()
 Get the MidiQueue instance associated to this client. More...
 
MidiQueuecreateQueue ()
 Create and return a new MidiQueue associated to this client. More...
 
MidiQueuecreateQueue (QString const &name)
 Create and return a new MidiQueue with the given name, associated to this client. More...
 
MidiQueueuseQueue (int queue_id)
 Create a new MidiQueue instance using a queue already existing in the system, associating it to the client. More...
 
MidiQueueuseQueue (const QString &name)
 Create a new MidiQueue instance using a queue already existing in the system, associating it to the client. More...
 
MidiQueueuseQueue (MidiQueue *queue)
 Associate an existing MidiQueue instance to the client. More...
 
QList< int > getAvailableQueues ()
 Get a list of the existing queues. More...
 
PortInfoList filterPorts (unsigned int filter)
 Gets a list of the available user ports in the system, filtered by the given bitmap of desired capabilities. More...
 
void updateAvailablePorts ()
 Update the internal lists of user ports.
 
PortInfoList getAvailableInputs ()
 Gets the available user input ports in the system. More...
 
PortInfoList getAvailableOutputs ()
 Gets the available user output ports in the system. More...
 
void addListener (QObject *listener)
 Adds a QObject to the listeners list. More...
 
void removeListener (QObject *listener)
 Removes a QObject listener from the listeners list. More...
 
void setEventsEnabled (const bool bEnabled)
 Enables the notification of received SequencerEvent instances to the listeners registered with addListener() More...
 
SystemInfogetSystemInfo ()
 Gets a SystemInfo instance with the updated state of the system. More...
 
PoolInfogetPoolInfo ()
 Gets a PoolInfo instance with an updated state of the client memory pool. More...
 
void setPoolInfo (const PoolInfo &info)
 Applies (updates) the client's PoolInfo data into the system. More...
 
void resetPoolInput ()
 Resets the client input pool. More...
 
void resetPoolOutput ()
 Resets the client output pool. More...
 
void setPoolInput (int size)
 Sets the size of the client's input pool. More...
 
void setPoolOutput (int size)
 Sets the size of the client's output pool. More...
 
void setPoolOutputRoom (int size)
 Sets the room size of the client's output pool. More...
 
void dropInput ()
 Clears the client's input buffer and and remove events in sequencer queue. More...
 
void dropInputBuffer ()
 Remove all events on user-space input buffer. More...
 
void dropOutput ()
 Clears the client's output buffer and and remove events in sequencer queue. More...
 
void dropOutputBuffer ()
 Removes all events on the library output buffer. More...
 
void removeEvents (const RemoveEvents *spec)
 Removes events on input/output buffers and pools. More...
 
SequencerEventextractOutput ()
 Extracts (and removes) the first event in the output buffer. More...
 
int outputPending ()
 Returns the size of pending events on the output buffer. More...
 
int inputPending (bool fetch)
 Gets the size of the events on the input buffer. More...
 
int getQueueId (const QString &name)
 Gets the queue's numeric identifier corresponding to the provided name. More...
 
int getPollDescriptorsCount (short events)
 Returns the number of poll descriptors. More...
 
int pollDescriptors (struct pollfd *pfds, unsigned int space, short events)
 Get poll descriptors. More...
 
unsigned short pollDescriptorsRevents (struct pollfd *pfds, unsigned int nfds)
 Gets the number of returned events from poll descriptors. More...
 
const char * _getDeviceName ()
 Gets the internal sequencer device name. More...
 
void _setClientName (const char *name)
 Sets the client name. More...
 
int createSimplePort (const char *name, unsigned int caps, unsigned int type)
 Create an ALSA sequencer port, without using MidiPort. More...
 
void deleteSimplePort (int port)
 Remove an ALSA sequencer port. More...
 
void connectFrom (int myport, int client, int port)
 Subscribe one port from another arbitrary sequencer client:port. More...
 
void connectTo (int myport, int client, int port)
 Subscribe one port to another arbitrary sequencer client:port. More...
 
void disconnectFrom (int myport, int client, int port)
 Unsubscribe one port from another arbitrary sequencer client:port. More...
 
void disconnectTo (int myport, int client, int port)
 Unsubscribe one port to another arbitrary sequencer client:port. More...
 
bool parseAddress (const QString &straddr, snd_seq_addr &result)
 Parse a text address representation, returning an ALSA address record. More...
 
bool stopped ()
 Returns true or false depending on the input thread state. More...
 
void stop ()
 Stops the input thread.
 
void run () override
 Main input thread process loop.
 
 ClientInfo ()
 Default constructor.
 
 ClientInfo (const ClientInfo &other)
 Copy constructor. More...
 
 ClientInfo (snd_seq_client_info_t *other)
 Copy constructor. More...
 
 ClientInfo (MidiClient *seq, int id)
 Constructor. More...
 
virtual ~ClientInfo ()
 Destructor.
 
ClientInfoclone ()
 Clone the client info object. More...
 
ClientInfooperator= (const ClientInfo &other)
 Assignment operator. More...
 
int getClientId ()
 Gets the client's numeric identifier. More...
 
snd_seq_client_type_t getClientType ()
 Gets the client's type. More...
 
QString getName ()
 Gets the client's name. More...
 
bool getBroadcastFilter ()
 Gets the client's broadcast filter. More...
 
bool getErrorBounce ()
 Gets the client's error bounce. More...
 
Q_DECL_DEPRECATED const unsigned char * getEventFilter ()
 Gets the client's event filter. More...
 
int getNumPorts ()
 Gets the client's port count. More...
 
int getEventLost ()
 Gets the number of lost events. More...
 
void setClient (int client)
 Sets the client identifier number. More...
 
void setName (QString name)
 Sets the client name. More...
 
void setBroadcastFilter (bool val)
 Sets the broadcast filter. More...
 
void setErrorBounce (bool val)
 Sets the error bounce. More...
 
Q_DECL_DEPRECATED void setEventFilter (unsigned char *filter)
 Sets the event filter. More...
 
void readPorts (MidiClient *seq)
 Read the client ports. More...
 
void freePorts ()
 Release the ports list.
 
PortInfoList getPorts () const
 Gets the ports list. More...
 
int getSizeOfInfo () const
 Gets the size of the internal object. More...
 
 SystemInfo ()
 Default constructor.
 
 SystemInfo (const SystemInfo &other)
 Copy constructor. More...
 
 SystemInfo (snd_seq_system_info_t *other)
 Copy constructor. More...
 
 SystemInfo (MidiClient *seq)
 Constructor. More...
 
virtual ~SystemInfo ()
 Destructor.
 
SystemInfoclone ()
 Clone the system info object. More...
 
SystemInfooperator= (const SystemInfo &other)
 Assignment operator. More...
 
int getMaxClients ()
 Get the system's maximum number of clients. More...
 
int getMaxPorts ()
 Get the system's maximum number of ports. More...
 
int getMaxQueues ()
 Get the system's maximum number of queues. More...
 
int getMaxChannels ()
 Get the system's maximum number of channels. More...
 
int getCurrentQueues ()
 Get the system's current number of queues. More...
 
int getCurrentClients ()
 Get the system's current number of clients. More...
 
int getSizeOfInfo () const
 Get the system's info object size. More...
 
 PoolInfo ()
 Default constructor.
 
 PoolInfo (const PoolInfo &other)
 Copy constructor. More...
 
 PoolInfo (snd_seq_client_pool_t *other)
 Copy constructor. More...
 
 PoolInfo (MidiClient *seq)
 Constructor. More...
 
virtual ~PoolInfo ()
 Destructor.
 
PoolInfoclone ()
 Clone the pool info obeject. More...
 
PoolInfooperator= (const PoolInfo &other)
 Assignment operator. More...
 
int getClientId ()
 Gets the client ID for this object. More...
 
int getInputFree ()
 Gets the available size on input pool. More...
 
int getInputPool ()
 Gets the input pool size. More...
 
int getOutputFree ()
 Gets the available size on output pool. More...
 
int getOutputPool ()
 Gets the output pool size. More...
 
int getOutputRoom ()
 Gets the output room size. More...
 
void setInputPool (int size)
 Set the input pool size. More...
 
void setOutputPool (int size)
 Sets the output pool size. More...
 
void setOutputRoom (int size)
 Sets the output room size. More...
 
int getSizeOfInfo () const
 Gets the size of the client pool object. More...
 

Detailed Description

ALSA clients are any entities using ALSA sequencer services.

A client may be an application or a device driver for an external MIDI port, like USB MIDI devices or the MIDI/game ports of some sound cards. This library allows to easily create applications managing ALSA clients.

ALSA clients are also file descriptors representing a sequencer device, that must be opened before reading or writing MIDI events. When the client is opened, it is given some handle and a number identifying it to other clients in the system. You can also provide a name for it.

Each ALSA sequencer client can have several ports attached. The ports can be readable or writable, and can be subscribed in pairs: one readable port to one writable port. The subscriptions can be made and queried by external applications, like "aconnect" or "qjackctl".

SystemInfo is an auxiliary class to query several system capabilities.

The PoolInfo class represents a container to query and change some values for the kernel memory pool assigned to an ALSA client.

The ClientInfo class is another container to query and change properties of the MidiClient itself.

The SequencerEventHandler abstract class is used to define an interface that other class can implement to receive sequencer events. It is one of the three methods of delivering input events offered by the library.

Input

MidiClient uses a separate thread to receive events from the ALSA sequencer. The input thread can be started and stopped using the methods MidiClient::startSequencerInput() and MidiClient::stopSequencerInput(). It is necessary to have this thread in mind when using this library to read events. There are three delivering methods of input events:

The selected method depends only on your requirements and your preferences.

Whichever method you select, it excludes the other methods for the same program. A callback takes precedence over the others. If it is not set, then the events are sent if MidiClient::setEventsEnabled() is called. If neither a callback handler is set nor events are enabled, then the signal is emitted. In any case, the event pointer must be deleted by the receiver method.

See also
https://doc.qt.io/qt-5/threads-reentrancy.html

Output

The methods to send a single event to the ALSA sequencer are:

The two first methods usually require a call to MidiClient::drainOutput() to flush the ALSA library output buffer. The third one bypasses the buffer, and doesn't require the call to MidiClient::drainOutput(). Note that the buffer can be automatically drained by the first method when it becomes full.

After being dispatched to the ALSA Sequencer, the events can be scheduled at some time in the future, or immediately. This depends on the following methods of the SequencerEvent class:

When you need to schedule a lot of events, for instance reproducing a Standard MIDI File (SMF) or a MIDI sequence, you may want to use the abstract class SequencerOutputThread.

Memory

There are two memory issues: the memory pool belongs to the kernel sequencer, and can be managed by the class PoolInfo and the methods MidiClient::getPoolInfo() and MidiClient::setPoolInfo(). The library buffer can be controlled using the methods MidiClient::getOutputBufferSize() and MidiClient::setOutputBufferSize() as well as MidiClient::getInputBufferSize() and MidiClient::setInputBufferSize().

See also
https://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_client.html

Function Documentation

◆ _getDeviceName()

const char * _getDeviceName ( )
protected

Gets the internal sequencer device name.

Returns
The device name.

Definition at line 1570 of file alsaclient.cpp.

◆ _setClientName()

void _setClientName ( const char *  name)
protected

Sets the client name.

Parameters
nameThe new client name.

Definition at line 1580 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ addEventFilter()

void addEventFilter ( int  evtype)

Add an event filter to the client.

Parameters
evtypeAn event filter to be added.

Definition at line 933 of file alsaclient.cpp.

◆ addListener()

void addListener ( QObject listener)

Adds a QObject to the listeners list.

This object should override the method QObject::customEvent() to receive SequencerEvent instances.

Parameters
listenerA QObject listener to be notified of received events.
See also
removeListener(), setEventsEnabled()

Definition at line 1291 of file alsaclient.cpp.

◆ ClientInfo() [1/3]

ClientInfo ( const ClientInfo other)

Copy constructor.

Parameters
otherAnother ClientInfo reference to be copied

Definition at line 1836 of file alsaclient.cpp.

◆ ClientInfo() [2/3]

ClientInfo ( MidiClient seq,
int  id 
)

Constructor.

Parameters
seqA MidiClient object
idA numeric client id

Definition at line 1858 of file alsaclient.cpp.

References MidiClient::getHandle().

◆ ClientInfo() [3/3]

ClientInfo ( snd_seq_client_info_t *  other)
explicit

Copy constructor.

Parameters
otherAn existing ALSA client info object

Definition at line 1847 of file alsaclient.cpp.

◆ clone() [1/3]

ClientInfo * clone ( )

Clone the client info object.

Returns
A pointer to the new object.

Definition at line 1878 of file alsaclient.cpp.

◆ clone() [2/3]

SystemInfo * clone ( )

Clone the system info object.

Returns
A pointer to the new object

Definition at line 2172 of file alsaclient.cpp.

◆ clone() [3/3]

PoolInfo * clone ( )

Clone the pool info obeject.

Returns
A pointer to the new object

Definition at line 2305 of file alsaclient.cpp.

◆ close()

void close ( )

Close the sequencer device.

After a client is closed, an event with SND_SEQ_EVENT_CLIENT_EXIT is broadcast to the announce port. The connection between other clients are disconnected. Call this just before exiting your program.

Definition at line 452 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING, and MidiClient::stopSequencerInput().

Referenced by MidiClient::~MidiClient().

◆ connectFrom()

void connectFrom ( int  myport,
int  client,
int  port 
)
protected

Subscribe one port from another arbitrary sequencer client:port.

Parameters
myportThe number of the internal port.
clientThe external client's identifier.
portThe external port's identifier.

Definition at line 1618 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ connectTo()

void connectTo ( int  myport,
int  client,
int  port 
)
protected

Subscribe one port to another arbitrary sequencer client:port.

Parameters
myportThe number of the internal port.
clientThe external client's identifier.
portThe external port's identifier.

Definition at line 1630 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ createPort()

MidiPort * createPort ( )

Create and attach a new MidiPort instance to this client.

Returns
The pointer to the new MidiPort instance.

Definition at line 865 of file alsaclient.cpp.

References MidiPort::attach().

◆ createQueue() [1/2]

MidiQueue * createQueue ( )

Create and return a new MidiQueue associated to this client.

Returns
A new MidiQueue instance.

Definition at line 1111 of file alsaclient.cpp.

Referenced by MidiClient::getQueue().

◆ createQueue() [2/2]

MidiQueue * createQueue ( QString const &  queueName)

Create and return a new MidiQueue with the given name, associated to this client.

Parameters
queueNameThe name for the new queue.
Returns
A new MidiQueue instance.

Definition at line 1127 of file alsaclient.cpp.

◆ createSimplePort()

int createSimplePort ( const char *  name,
unsigned int  caps,
unsigned int  type 
)
protected

Create an ALSA sequencer port, without using MidiPort.

Parameters
nameThe name of the new port.
capsThe new port capabilities.
typeThe type of the new port.
Returns
The port numeric identifier.

Definition at line 1593 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ deleteSimplePort()

void deleteSimplePort ( int  port)
protected

Remove an ALSA sequencer port.

Parameters
portThe numeric identifier of the port.

Definition at line 1606 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ disconnectFrom()

void disconnectFrom ( int  myport,
int  client,
int  port 
)
protected

Unsubscribe one port from another arbitrary sequencer client:port.

Parameters
myportThe number of the internal port.
clientThe external client's identifier.
portThe external port's identifier.

Definition at line 1642 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ disconnectTo()

void disconnectTo ( int  myport,
int  client,
int  port 
)
protected

Unsubscribe one port to another arbitrary sequencer client:port.

Parameters
myportThe number of the internal port.
clientThe external client's identifier.
portThe external port's identifier.

Definition at line 1654 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ doEvents()

void doEvents ( )
protected

Dispatch the events received from the Sequencer.

There are three methods of events delivering:

  • A Callback method. To use this method, you must derive a class from SequencerEventHandler, overriding the method SequencerEventHandler::handleSequencerEvent() to provide your own event processing. You must provide the handler instance to the client using setHandler().
  • Using QEvent listeners. To use this method, you must use one or more classes derived from QObject overriding the method QObject::customEvent(). You must also use the method addListener() to add such objects to the client's listeners list.
  • The third method involves signals and slots. Whenever a sequencer event is received, a signal eventReceived() is emitted, that can be connected to your own supplied slot(s) to process it.
See also
ALSA Sequencer Clients

Definition at line 588 of file alsaclient.cpp.

References MidiClient::eventReceived().

◆ drainOutput()

void drainOutput ( bool  async = false,
int  timeout = -1 
)

Drain the library output buffer.

This function drains all pending events on the output buffer. The function returns immediately after the events are sent to the queues regardless whether the events are processed or not.

Parameters
asyncUse asynchronous mode. If false, this call will block until the buffer can be flushed.
timeoutThe maximum time to wait in synchronous mode.

Definition at line 1065 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ dropInput()

void dropInput ( )

Clears the client's input buffer and and remove events in sequencer queue.

See also
resetPoolInput()

Definition at line 1409 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ dropInputBuffer()

void dropInputBuffer ( )

Remove all events on user-space input buffer.

See also
dropInput()

Definition at line 1419 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ dropOutput()

void dropOutput ( )

Clears the client's output buffer and and remove events in sequencer queue.

This method removes all events on both user-space output buffer and output memory pool on kernel.

See also
resetPoolOutput()

Definition at line 1432 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ dropOutputBuffer()

void dropOutputBuffer ( )

Removes all events on the library output buffer.

Removes all events on the user-space output buffer. Unlike dropOutput(), this method doesn't remove events on the client's output memory pool.

See also
dropOutput()

Definition at line 1445 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ extractOutput()

SequencerEvent * extractOutput ( )

Extracts (and removes) the first event in the output buffer.

Returns
The extracted event.

Definition at line 1467 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ filterPorts()

PortInfoList filterPorts ( unsigned int  filter)
protected

Gets a list of the available user ports in the system, filtered by the given bitmap of desired capabilities.

Parameters
filterA bitmap of capabilities.
Returns
A filtered list of the available ports in the system.

Definition at line 1219 of file alsaclient.cpp.

References PortInfo::getCapability(), ClientInfo::getClientId(), ClientInfo::getPorts(), and MidiClient::readClients().

Referenced by MidiClient::updateAvailablePorts().

◆ getAvailableClients()

ClientInfoList getAvailableClients ( )

Gets the list of clients from the ALSA sequencer.

Returns
the list of clients.
Examples
sysinfo.cpp.

Definition at line 764 of file alsaclient.cpp.

References MidiClient::readClients().

◆ getAvailableInputs()

PortInfoList getAvailableInputs ( )

Gets the available user input ports in the system.

Returns
The list of available input ports.

Definition at line 1265 of file alsaclient.cpp.

References MidiClient::updateAvailablePorts().

◆ getAvailableOutputs()

PortInfoList getAvailableOutputs ( )

Gets the available user output ports in the system.

Returns
The list of available output ports.

Definition at line 1277 of file alsaclient.cpp.

References MidiClient::updateAvailablePorts().

◆ getAvailableQueues()

QList< int > getAvailableQueues ( )

Get a list of the existing queues.

Returns
a list of existing queues
Examples
sysinfo.cpp.

Definition at line 1195 of file alsaclient.cpp.

References SystemInfo::getMaxQueues(), and MidiClient::getSystemInfo().

◆ getBlockMode()

bool getBlockMode ( )

Returns the last block mode used in open()

Returns
the last block mode

Definition at line 322 of file alsaclient.cpp.

◆ getBroadcastFilter() [1/2]

bool getBroadcastFilter ( )

Gets the client's broadcast filter.

Returns
The client's broadcast filter.

Definition at line 1933 of file alsaclient.cpp.

◆ getBroadcastFilter() [2/2]

bool getBroadcastFilter ( )

Gets the broadcast filter usage of the client.

Returns
The broadcast filter.

Definition at line 944 of file alsaclient.cpp.

◆ getClientId() [1/3]

int getClientId ( )

Gets the client's numeric identifier.

Returns
The client's numeric identifier.
Examples
sysinfo.cpp.

Definition at line 1903 of file alsaclient.cpp.

Referenced by MidiClient::filterPorts(), and MidiClient::parseAddress().

◆ getClientId() [2/3]

int getClientId ( )

Gets the client ID for this object.

Returns
The client ID.

Definition at line 2329 of file alsaclient.cpp.

◆ getClientId() [3/3]

int getClientId ( )

Gets the client ID.

Returns the ID of the client. A client ID is necessary to inquiry or to set the client information. A user client ID is assigned from 128 to 191.

Returns
the client ID.

Definition at line 552 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

Referenced by MidiClient::portDetach(), ClientInfo::readPorts(), and SequencerOutputThread::sendEchoEvent().

◆ getClientName() [1/2]

QString getClientName ( )

Gets the client's public name.

Returns
The client's name

Definition at line 813 of file alsaclient.cpp.

Referenced by MidiPort::getReadSubscribers(), and MidiPort::getWriteSubscribers().

◆ getClientName() [2/2]

QString getClientName ( const int  clientId)

Gets the public name corresponding to the given Client ID.

Parameters
clientIdThe ID of any existing sequencer client
Returns
The client's name

Definition at line 824 of file alsaclient.cpp.

References MidiClient::readClients().

◆ getClientType()

snd_seq_client_type_t getClientType ( )

Gets the client's type.

Returns
The client's type.
Examples
sysinfo.cpp.

Definition at line 1913 of file alsaclient.cpp.

◆ getCompiledALSALibraryVersion()

DRUMSTICK_ALSA_EXPORT QString getCompiledALSALibraryVersion ( )

ALSA library version at build time.

This string corresponds to the compilation library, which may be different to the runtime library.

Returns
ALSA runtime library formatted as a QString
See also
getRuntimeALSALibraryVersion

Definition at line 2520 of file alsaclient.cpp.

◆ getCurrentClients()

int getCurrentClients ( )

Get the system's current number of clients.

Returns
The system's current number of clients.
Examples
sysinfo.cpp.

Definition at line 2240 of file alsaclient.cpp.

◆ getCurrentQueues()

int getCurrentQueues ( )

Get the system's current number of queues.

Returns
The system's current number of queues.
Examples
sysinfo.cpp.

Definition at line 2231 of file alsaclient.cpp.

◆ getDeviceName()

QString getDeviceName ( )

Returns the name of the sequencer device.

Returns
the device name

Definition at line 304 of file alsaclient.cpp.

◆ getDrumstickLibraryVersion()

DRUMSTICK_ALSA_EXPORT QString getDrumstickLibraryVersion ( )

getDrumstickLibraryVersion provides the Drumstick version as an edited QString

Returns
Drumstick library version

Definition at line 2529 of file alsaclient.cpp.

◆ getErrorBounce() [1/2]

bool getErrorBounce ( )

Gets the client's error bounce.

Returns
The client's error bounce.

Definition at line 1943 of file alsaclient.cpp.

◆ getErrorBounce() [2/2]

bool getErrorBounce ( )

Get the error-bounce usage of the client.

Returns
The error-bounce usage.

Definition at line 967 of file alsaclient.cpp.

◆ getEventFilter()

const unsigned char * getEventFilter ( )
protected

Gets the client's event filter.

Returns
The client's event filter.
Deprecated:
Use isFiltered() instead.

Definition at line 1954 of file alsaclient.cpp.

◆ getEventLost()

int getEventLost ( )

Gets the number of lost events.

Returns
The number of lost events.

Definition at line 1974 of file alsaclient.cpp.

◆ getEventsEnabled()

bool getEventsEnabled ( ) const

Returns true if the events mode of delivery has been enabled.

Returns
whether the events mode of delivery is enabled

Definition at line 331 of file alsaclient.cpp.

◆ getHandle()

◆ getInputBufferSize()

size_t getInputBufferSize ( )

Gets the size of the library input buffer for the ALSA client.

This buffer is used to read a byte-stream of input events before transferring from the sequencer.

Returns
the size of the library input buffer

Definition at line 500 of file alsaclient.cpp.

Referenced by MidiClient::setInputBufferSize().

◆ getInputFree()

int getInputFree ( )

Gets the available size on input pool.

Returns
The available size on input pool.

Definition at line 2339 of file alsaclient.cpp.

◆ getInputPool()

int getInputPool ( )

Gets the input pool size.

Returns
The input pool size.

Definition at line 2349 of file alsaclient.cpp.

◆ getMaxChannels()

int getMaxChannels ( )

Get the system's maximum number of channels.

Returns
The system's maximum number of channels.
Examples
sysinfo.cpp.

Definition at line 2222 of file alsaclient.cpp.

◆ getMaxClients()

int getMaxClients ( )

Get the system's maximum number of clients.

Returns
The maximum number of clients.
Examples
sysinfo.cpp.

Definition at line 2195 of file alsaclient.cpp.

◆ getMaxPorts()

int getMaxPorts ( )

Get the system's maximum number of ports.

Returns
The maximum number of ports.
Examples
sysinfo.cpp.

Definition at line 2204 of file alsaclient.cpp.

◆ getMaxQueues()

int getMaxQueues ( )

Get the system's maximum number of queues.

Returns
The system's maximum number of queues.
Examples
sysinfo.cpp.

Definition at line 2213 of file alsaclient.cpp.

Referenced by MidiClient::getAvailableQueues().

◆ getMidiPorts()

MidiPortList getMidiPorts ( ) const

Gets the list of MidiPort instances belonging to this client.

Returns
The list of MidiPort instances.

Definition at line 855 of file alsaclient.cpp.

◆ getName()

QString getName ( )

Gets the client's name.

Returns
The client's name.
Examples
sysinfo.cpp.

Definition at line 1923 of file alsaclient.cpp.

Referenced by MidiClient::parseAddress().

◆ getNumPorts()

int getNumPorts ( )

Gets the client's port count.

Returns
The client's port count.

Definition at line 1964 of file alsaclient.cpp.

◆ getOpenMode()

int getOpenMode ( )

Returns the last open mode used in open()

Returns
the last open mode

Definition at line 313 of file alsaclient.cpp.

◆ getOutputBufferSize()

size_t getOutputBufferSize ( )

Gets the size of the library output buffer for the ALSA client.

This buffer is used to store the decoded byte-stream of output events before transferring to the sequencer.

Returns
the size of the library output buffer

Definition at line 470 of file alsaclient.cpp.

Referenced by MidiClient::setOutputBufferSize().

◆ getOutputFree()

int getOutputFree ( )

Gets the available size on output pool.

Returns
The available size on output pool.

Definition at line 2359 of file alsaclient.cpp.

◆ getOutputPool()

int getOutputPool ( )

Gets the output pool size.

Returns
The output pool size.

Definition at line 2369 of file alsaclient.cpp.

◆ getOutputRoom()

int getOutputRoom ( )

Gets the output room size.

The output room is the minimum pool size for select/blocking mode.

Returns
The output room size.

Definition at line 2380 of file alsaclient.cpp.

◆ getPollDescriptorsCount()

int getPollDescriptorsCount ( short  events)
protected

Returns the number of poll descriptors.

Parameters
eventsPoll events to be checked (POLLIN and POLLOUT).
Returns
The number of poll descriptors.

Definition at line 1524 of file alsaclient.cpp.

◆ getPoolInfo()

PoolInfo & getPoolInfo ( )

Gets a PoolInfo instance with an updated state of the client memory pool.

Returns
The updated memory pool state.

Definition at line 1337 of file alsaclient.cpp.

◆ getPorts()

PortInfoList getPorts ( ) const

Gets the ports list.

Returns
The ports list.
Examples
sysinfo.cpp.

Definition at line 2062 of file alsaclient.cpp.

Referenced by MidiClient::filterPorts().

◆ getQueue()

MidiQueue * getQueue ( )

Get the MidiQueue instance associated to this client.

If the client is not associated to a MidiQueue, one is created.

Returns
A MidiQueue instance pointer

Definition at line 1098 of file alsaclient.cpp.

References MidiClient::createQueue().

Referenced by SequencerOutputThread::SequencerOutputThread().

◆ getQueueId()

int getQueueId ( const QString &  name)

Gets the queue's numeric identifier corresponding to the provided name.

Parameters
nameThe name string to query.
Returns
The number of the matching queue.

Definition at line 1513 of file alsaclient.cpp.

Referenced by MidiClient::useQueue().

◆ getRuntimeALSADriverNumber()

DRUMSTICK_ALSA_EXPORT int getRuntimeALSADriverNumber ( )

Gets the runtime ALSA drivers version number.

Returns
integer representing the runtime ALSA drivers version
Since
0.3.0

Definition at line 2493 of file alsaclient.cpp.

References drumstick::ALSA::getRuntimeALSADriverVersion().

◆ getRuntimeALSADriverVersion()

DRUMSTICK_ALSA_EXPORT QString getRuntimeALSADriverVersion ( )

Gets the runtime ALSA drivers version string.

Returns
string representing the runtime ALSA drivers version
Since
0.3.0

Definition at line 2471 of file alsaclient.cpp.

Referenced by drumstick::ALSA::getRuntimeALSADriverNumber().

◆ getSequencerType()

snd_seq_type_t getSequencerType ( )

Returns the type snd_seq_type_t of the given sequencer handle.

Returns
the type snd_seq_type_t of the given sequencer handle.

Definition at line 562 of file alsaclient.cpp.

◆ getSizeOfInfo() [1/3]

int getSizeOfInfo ( ) const

Gets the size of the internal object.

Returns
The size of the internal object.

Definition at line 2073 of file alsaclient.cpp.

◆ getSizeOfInfo() [2/3]

int getSizeOfInfo ( ) const

Get the system's info object size.

Returns
The system's info object size.

Definition at line 2249 of file alsaclient.cpp.

◆ getSizeOfInfo() [3/3]

int getSizeOfInfo ( ) const

Gets the size of the client pool object.

Returns
The size of the client pool object.

Definition at line 2422 of file alsaclient.cpp.

◆ getSystemInfo()

SystemInfo & getSystemInfo ( )

Gets a SystemInfo instance with the updated state of the system.

Returns
The updated system info.
Examples
sysinfo.cpp.

Definition at line 1326 of file alsaclient.cpp.

Referenced by MidiClient::getAvailableQueues().

◆ getThisClientInfo()

ClientInfo & getThisClientInfo ( )

Gets the ClientInfo object holding data about this client.

Returns
the ClientInfo object representing this client.

Definition at line 777 of file alsaclient.cpp.

◆ inputPending()

int inputPending ( bool  fetch)

Gets the size of the events on the input buffer.

If there are events remaining on the user-space input buffer, this method returns the total size of events on it. If the argument is true, this method checks the presence of events on the sequencer FIFO, and when events exist they are transferred to the input buffer, and the number of received events are returned. If the argument is false and no events remain on the input buffer, this method simply returns zero.

Parameters
fetchCheck and fetch the sequencer input pool.
Returns
The size in bytes of the remaining input events on the buffer.

Definition at line 1501 of file alsaclient.cpp.

◆ isOpened()

bool isOpened ( )

Returns true if the sequencer is opened.

Returns
wheter the sequencer is opened

Definition at line 295 of file alsaclient.cpp.

Referenced by MidiPort::applyPortInfo(), Subscription::subscribe(), and Subscription::unsubscribe().

◆ MidiClient()

MidiClient ( QObject parent = nullptr)
explicit

Constructor.

This constructor optionally gets a QObject parent. When you create a MidiClient with another object as parent, the MidiClient object will automatically add itself to the parent's children() list. The parent takes ownership of the object i.e. it will automatically delete its children in its destructor.

It is necessary to invoke open() later to get the sequencer client handler from the ALSA sequencer subsystem.

Parameters
parentThe optional parent object

Definition at line 258 of file alsaclient.cpp.

◆ open() [1/2]

void open ( const QString  deviceName = "default",
const int  openMode = SND_SEQ_OPEN_DUPLEX,
const bool  blockMode = false 
)

Open the sequencer device.

When opening the MidiClient instance, several properties may optionally be set as the device name, the open mode and block mode. Default values are provided for them. After a successful open, an event with SND_SEQ_EVENT_CLIENT_START is broadcast to the announce port.

Parameters
deviceNamethe sequencer device name, default value = "default". This is not a name you make up for your own purposes; it has special significance to the ALSA library. Usually you need to pass "default" here.
openModethe open mode, default value = SND_SEQ_OPEN_DUPLEX. The read/write mode of the sequencer. Can be one of these three values:
  • SND_SEQ_OPEN_OUTPUT - open the sequencer for output only
  • SND_SEQ_OPEN_INPUT - open the sequencer for input only
  • SND_SEQ_OPEN_DUPLEX - open the sequencer for output and input
blockModeopen in blocking mode, default value = false.
Examples
sysinfo.cpp.

Definition at line 395 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_ERROR, and DRUMSTICK_ALSA_CHECK_WARNING.

◆ open() [2/2]

void open ( snd_config_t *  conf,
const QString  deviceName = "default",
const int  openMode = SND_SEQ_OPEN_DUPLEX,
const bool  blockMode = false 
)

Open the sequencer device, providing a configuration object pointer.

This method is like open() except that a configuration is explicitly provided. After a successful open, an event with SND_SEQ_EVENT_CLIENT_START type is broadcasted from the announce port.

Parameters
confa configuration object pointer.
deviceNamethe sequencer device name, default value = "default". This is not a name you make up for your own purposes; it has special significance to the ALSA library. Usually you need to pass "default" here.
openModethe open mode, default value = SND_SEQ_OPEN_DUPLEX. The read/write mode of the sequencer. Can be one of these three values:
  • SND_SEQ_OPEN_OUTPUT - open the sequencer for output only
  • SND_SEQ_OPEN_INPUT - open the sequencer for input only
  • SND_SEQ_OPEN_DUPLEX - open the sequencer for output and input
blockModeopen in blocking mode, default value = false.

Definition at line 428 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_ERROR, and DRUMSTICK_ALSA_CHECK_WARNING.

◆ operator=() [1/3]

ClientInfo & operator= ( const ClientInfo other)

Assignment operator.

Parameters
otherAnother ClientInfo object
Returns
This object

Definition at line 1889 of file alsaclient.cpp.

◆ operator=() [2/3]

PoolInfo & operator= ( const PoolInfo other)

Assignment operator.

Parameters
otherAnother PoolInfo object reference to be copied
Returns
This object

Definition at line 2316 of file alsaclient.cpp.

◆ operator=() [3/3]

SystemInfo & operator= ( const SystemInfo other)

Assignment operator.

Parameters
otherAnother SystemInfo object
Returns
This object

Definition at line 2183 of file alsaclient.cpp.

◆ output()

void output ( SequencerEvent ev,
bool  async = false,
int  timeout = -1 
)

Output an event using the library output buffer.

An event is once expanded on the output buffer. The output buffer will be drained automatically if it becomes full.

Parameters
evThe event to be sent.
asyncUse asynchronous mode. If false, this call will block until the event can be delivered.
timeoutThe maximum time to wait in synchronous mode.

Definition at line 996 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING, and SequencerEvent::getHandle().

◆ outputBuffer()

void outputBuffer ( SequencerEvent ev)

Output an event using the library output buffer, without draining the buffer.

An event is once expanded on the output buffer. The output buffer will NOT be drained automatically if it becomes full.

Parameters
evThe event to be sent.

Definition at line 1049 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING, and SequencerEvent::getHandle().

◆ outputDirect()

void outputDirect ( SequencerEvent ev,
bool  async = false,
int  timeout = -1 
)

Output an event directly to the sequencer.

This function sends an event to the sequencer directly not using the library output buffer.

Parameters
evThe event to be sent.
asyncUse asynchronous mode. If false, this call will block until the event is delivered to the sequencer.
timeoutThe maximum time to wait in synchronous mode.

Definition at line 1024 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING, and SequencerEvent::getHandle().

Referenced by MidiQueue::setRealTimePosition(), and MidiQueue::setTickPosition().

◆ outputPending()

int outputPending ( )

Returns the size of pending events on the output buffer.

Returns
The size of pending events.

Definition at line 1482 of file alsaclient.cpp.

◆ parseAddress()

bool parseAddress ( const QString &  straddr,
snd_seq_addr &  addr 
)

Parse a text address representation, returning an ALSA address record.

This function can be used as a replacement of the standard ALSA function snd_seq_parse_address().

Parameters
straddrsource text address representation
addrreturned ALSA address record
Returns
true if the text address was successfully parsed
Since
0.3.1

Definition at line 1671 of file alsaclient.cpp.

References ClientInfo::getClientId(), ClientInfo::getName(), and MidiClient::readClients().

Referenced by MidiPort::subscribeFrom(), MidiPort::subscribeTo(), MidiPort::unsubscribeFrom(), and MidiPort::unsubscribeTo().

◆ pollDescriptors()

int pollDescriptors ( struct pollfd *  pfds,
unsigned int  space,
short  events 
)
protected

Get poll descriptors.

Get poll descriptors assigned to the sequencer handle. Since a sequencer handle can duplex streams, you need to set which direction(s) is/are polled in events argument. When POLLIN bit is specified, the incoming events to the ports are checked.

Parameters
pfdsArray of poll descriptors
spaceSpace in the poll descriptor array
eventsPolling events to be checked (POLLIN and POLLOUT)
Returns
Count of filled descriptors

Definition at line 1543 of file alsaclient.cpp.

◆ pollDescriptorsRevents()

unsigned short pollDescriptorsRevents ( struct pollfd *  pfds,
unsigned int  nfds 
)
protected

Gets the number of returned events from poll descriptors.

Parameters
pfdsArray of poll descriptors.
nfdsCount of poll descriptors.
Returns
Number of returned events.

Definition at line 1556 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ PoolInfo() [1/3]

PoolInfo ( const PoolInfo other)

Copy constructor.

Parameters
otherAnother PoolInfo object reference to be copied

Definition at line 2266 of file alsaclient.cpp.

◆ PoolInfo() [2/3]

PoolInfo ( MidiClient seq)
explicit

Constructor.

Parameters
seqA MidiClient object

Definition at line 2286 of file alsaclient.cpp.

References MidiClient::getHandle().

◆ PoolInfo() [3/3]

PoolInfo ( snd_seq_client_pool_t *  other)
explicit

Copy constructor.

Parameters
otherAn ALSA pool info object to be copied

Definition at line 2276 of file alsaclient.cpp.

◆ portAttach()

void portAttach ( MidiPort port)

Attach a MidiPort instance to this client.

Parameters
portThe MidiPort to be attached

Definition at line 877 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_ERROR.

Referenced by MidiPort::attach().

◆ portDetach()

void portDetach ( MidiPort port)

Detach a MidiPort instance from this client.

Parameters
portThe MidiPort to be detached

Definition at line 890 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_ERROR, PortInfo::getClient(), MidiClient::getClientId(), PortInfo::getPort(), MidiPort::getPortInfo(), and MidiPort::setMidiClient().

Referenced by MidiPort::detach().

◆ readPorts()

void readPorts ( MidiClient seq)
protected

Read the client ports.

Parameters
seqThe client instance.

Definition at line 2035 of file alsaclient.cpp.

References MidiClient::getClientId(), MidiClient::getHandle(), PortInfo::readSubscribers(), PortInfo::setClient(), PortInfo::setClientName(), and PortInfo::setPort().

Referenced by MidiClient::readClients().

◆ realTimeInputEnabled()

bool realTimeInputEnabled ( )

Return the real-time priority setting for the MIDI input thread.

Returns
true if the real-time priority is enabled
Since
0.5.0

Definition at line 367 of file alsaclient.cpp.

◆ removeEvents()

void removeEvents ( const RemoveEvents spec)

Removes events on input/output buffers and pools.

Removes matching events with the given condition from input/output buffers and pools. The removal condition is specified in the spec argument.

Parameters
specA RemoveEvents instance specifying the removal condition.

Definition at line 1457 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ removeListener()

void removeListener ( QObject listener)

Removes a QObject listener from the listeners list.

Parameters
listenerlistener A QObject listener to be removed of received events.
See also
addListener(), setEventsEnabled()

Definition at line 1302 of file alsaclient.cpp.

◆ resetPoolInput()

void resetPoolInput ( )

Resets the client input pool.

See also
dropInput()

Definition at line 1359 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ resetPoolOutput()

void resetPoolOutput ( )

Resets the client output pool.

See also
dropOutput()

Definition at line 1369 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ setBlockMode()

void setBlockMode ( bool  newValue)

Change the blocking mode of the client.

In block mode, the client falls into sleep when it fills the output memory pool with full events. The client will be woken up after a certain amount of free space becomes available.

Parameters
newValuethe blocking mode

Definition at line 531 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ setBroadcastFilter() [1/2]

void setBroadcastFilter ( bool  newValue)

Sets the broadcast filter usage of the client.

Parameters
newValueThe broadcast filter.

Definition at line 955 of file alsaclient.cpp.

References MidiClient::applyClientInfo().

◆ setBroadcastFilter() [2/2]

void setBroadcastFilter ( bool  val)

Sets the broadcast filter.

Parameters
valThe broadcast filter.

Definition at line 2004 of file alsaclient.cpp.

◆ setClient()

void setClient ( int  client)

Sets the client identifier number.

Parameters
clientThe client identifier number.

Definition at line 1984 of file alsaclient.cpp.

Referenced by MidiClient::readClients().

◆ setClientName()

void setClientName ( QString const &  newName)

Changes the public name of the ALSA sequencer client.

Parameters
newNameA new public name
Examples
sysinfo.cpp.

Definition at line 842 of file alsaclient.cpp.

References MidiClient::applyClientInfo().

◆ setErrorBounce() [1/2]

void setErrorBounce ( bool  newValue)

Sets the error-bounce usage of the client.

Parameters
newValueThe error-bounce usage.

Definition at line 978 of file alsaclient.cpp.

References MidiClient::applyClientInfo().

◆ setErrorBounce() [2/2]

void setErrorBounce ( bool  val)

Sets the error bounce.

Parameters
valThe error bounce.

Definition at line 2014 of file alsaclient.cpp.

◆ setEventFilter()

void setEventFilter ( unsigned char *  filter)
protected

Sets the event filter.

Parameters
filterThe event filter.
Deprecated:
Use addFilter() instead.

Definition at line 2025 of file alsaclient.cpp.

◆ setEventsEnabled()

void setEventsEnabled ( const bool  bEnabled)

Enables the notification of received SequencerEvent instances to the listeners registered with addListener()

Parameters
bEnabledThe new state of the events delivering mode.
See also
addListener(), removeListener(), setEventsEnabled()

Definition at line 1314 of file alsaclient.cpp.

◆ setHandler()

void setHandler ( SequencerEventHandler handler)

Sets a sequencer event handler enabling the callback delivery mode.

Parameters
handlerthe sequencer event handler

Definition at line 340 of file alsaclient.cpp.

◆ setInputBufferSize()

void setInputBufferSize ( size_t  newSize)

Sets the size of the library input buffer for the ALSA client.

This buffer is used to read a byte-stream of input events before transferring from the sequencer.

Parameters
newSizethe size of the library input buffer

Definition at line 514 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING, and MidiClient::getInputBufferSize().

◆ setInputPool()

void setInputPool ( int  size)

Set the input pool size.

Parameters
sizeThe input pool size.

Definition at line 2390 of file alsaclient.cpp.

◆ setName()

void setName ( QString  name)

Sets the client name.

Parameters
nameThe client name.

Definition at line 1994 of file alsaclient.cpp.

◆ setOutputBufferSize()

void setOutputBufferSize ( size_t  newSize)

Sets the size of the library output buffer for the ALSA client.

This buffer is used to store the decoded byte-stream of output events before transferring to the sequencer.

Parameters
newSizethe size of the library output buffer

Definition at line 484 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING, and MidiClient::getOutputBufferSize().

◆ setOutputPool()

void setOutputPool ( int  size)

Sets the output pool size.

Parameters
sizeThe output pool size.

Definition at line 2400 of file alsaclient.cpp.

◆ setOutputRoom()

void setOutputRoom ( int  size)

Sets the output room size.

The output room is the minimum pool size for select/blocking mode.

Parameters
sizeOutput room size

Definition at line 2412 of file alsaclient.cpp.

◆ setPoolInfo()

void setPoolInfo ( const PoolInfo info)

Applies (updates) the client's PoolInfo data into the system.

Parameters
infoThe PoolInfo reference to be applied to the client.

Definition at line 1348 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ setPoolInput()

void setPoolInput ( int  size)

Sets the size of the client's input pool.

Parameters
sizeThe new size

Definition at line 1379 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ setPoolOutput()

void setPoolOutput ( int  size)

Sets the size of the client's output pool.

Parameters
sizeThe new size

Definition at line 1389 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ setPoolOutputRoom()

void setPoolOutputRoom ( int  size)

Sets the room size of the client's output pool.

Parameters
sizeThe new size

Definition at line 1399 of file alsaclient.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING.

◆ setRealTimeInput()

void setRealTimeInput ( bool  enable)

Enables real-time priority for the MIDI input thread.

The system needs either RLIMIT_RTPRIO or RealtimeKit. First RLIMIT_RTPRIO is tried, and if this method fails, RealtimeKit is used.

Parameters
enablereal-time priority enabled
Since
0.5.0

Definition at line 354 of file alsaclient.cpp.

◆ setThisClientInfo()

void setThisClientInfo ( const ClientInfo val)

Sets the data supplied by the ClientInfo object into the ALSA sequencer client.

This allows to change the name, capabilities, type and other data in a single step.

Parameters
vala ClientInfo object reference

Definition at line 791 of file alsaclient.cpp.

◆ stopped()

bool stopped ( )

Returns true or false depending on the input thread state.

Returns
true if the input thread is stopped.

Definition at line 1708 of file alsaclient.cpp.

◆ synchronizeOutput()

void synchronizeOutput ( )

Wait until all sent events are processed.

This function waits until all events of this client are processed.

Definition at line 1087 of file alsaclient.cpp.

Referenced by SequencerOutputThread::syncOutput().

◆ SystemInfo() [1/3]

SystemInfo ( const SystemInfo other)

Copy constructor.

Parameters
otherAnother SystemInfo object reference to be copied

Definition at line 2133 of file alsaclient.cpp.

◆ SystemInfo() [2/3]

SystemInfo ( MidiClient seq)
explicit

Constructor.

Parameters
seqA MidiClient object

Definition at line 2153 of file alsaclient.cpp.

References MidiClient::getHandle().

◆ SystemInfo() [3/3]

SystemInfo ( snd_seq_system_info_t *  other)
explicit

Copy constructor.

Parameters
otherAnother ALSA system info object to be copied

Definition at line 2143 of file alsaclient.cpp.

◆ useQueue() [1/3]

MidiQueue * useQueue ( const QString &  name)

Create a new MidiQueue instance using a queue already existing in the system, associating it to the client.

Parameters
nameAn existing queue name.
Returns
A new MidiQueue instance.

Definition at line 1161 of file alsaclient.cpp.

References MidiClient::getQueueId().

◆ useQueue() [2/3]

MidiQueue * useQueue ( int  queue_id)

Create a new MidiQueue instance using a queue already existing in the system, associating it to the client.

Parameters
queue_idAn existing queue identifier.
Returns
A new MidiQueue instance.

Definition at line 1144 of file alsaclient.cpp.

◆ useQueue() [3/3]

MidiQueue * useQueue ( MidiQueue queue)

Associate an existing MidiQueue instance to the client.

Parameters
queueAn existing MidiQueue.
Returns
The provided MidiQueue instance.

Definition at line 1180 of file alsaclient.cpp.

◆ ~MidiClient()

~MidiClient ( )
virtual

Destructor.

The ports and queue associated to this client are automatically released.

Definition at line 271 of file alsaclient.cpp.

References MidiClient::close(), MidiClient::detachAllPorts(), MidiClient::freeClients(), and MidiClient::stopSequencerInput().