drumstick
0.5.0
|
Client management. More...
#include <alsaclient.h>
Classes | |
class | SequencerInputThread |
This class manages event input from the ALSA sequencer. More... | |
Signals | |
void | eventReceived (SequencerEvent *ev) |
Signal emitted when an event is received. | |
Public Member Functions | |
MidiClient (QObject *parent=0) | |
Constructor. More... | |
virtual | ~MidiClient () |
Destructor. 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... | |
void | startSequencerInput () |
Starts reading events from the ALSA sequencer. | |
void | stopSequencerInput () |
Stops reading events from the ALSA sequencer. | |
MidiPort * | createPort () |
Create and attach a new MidiPort instance to this client. More... | |
MidiQueue * | createQueue () |
Create and return a new MidiQueue associated to this client. More... | |
MidiQueue * | createQueue (QString const &name) |
Create and return a new MidiQueue with the given name, associated to this client. More... | |
MidiQueue * | getQueue () |
Get the MidiQueue instance associated to this client. More... | |
MidiQueue * | useQueue (int queue_id) |
Create a new MidiQueue instance using a queue already existing in the system, associating it to the client. More... | |
MidiQueue * | useQueue (const QString &name) |
Create a new MidiQueue instance using a queue already existing in the system, associating it to the client. More... | |
MidiQueue * | useQueue (MidiQueue *queue) |
Associate an existing MidiQueue instance to the 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... | |
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... | |
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... | |
snd_seq_t * | getHandle () |
Returns the sequencer handler managed by ALSA. | |
bool | isOpened () |
Returns true if the sequencer is opened. | |
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... | |
QString | getDeviceName () |
Returns the name of the sequencer device. | |
int | getOpenMode () |
Returns the last open mode used in open() | |
bool | getBlockMode () |
Returns the last block mode used in open() | |
void | setBlockMode (bool newValue) |
Change the blocking mode of the client. More... | |
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... | |
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... | |
ClientInfo & | getThisClientInfo () |
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... | |
MidiPortList | getMidiPorts () const |
Gets the list of MidiPort instances belonging to this client. More... | |
ClientInfoList | getAvailableClients () |
Gets the list of clients from the ALSA sequencer. More... | |
PortInfoList | getAvailableInputs () |
Gets the available user input ports in the system. More... | |
PortInfoList | getAvailableOutputs () |
Gets the available user output ports in the system. More... | |
SystemInfo & | getSystemInfo () |
Gets a SystemInfo instance with the updated state of the system. More... | |
QList< int > | getAvailableQueues () |
Get a list of the existing queues. More... | |
PoolInfo & | getPoolInfo () |
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 | 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 | resetPoolInput () |
Resets the client input pool. More... | |
void | resetPoolOutput () |
Resets the client 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... | |
SequencerEvent * | extractOutput () |
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... | |
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... | |
bool | getEventsEnabled () const |
Returns true if the events mode of delivery has been enabled. | |
void | setHandler (SequencerEventHandler *handler) |
Sets a sequencer event handler enabling the callback delivery mode. | |
bool | parseAddress (const QString &straddr, snd_seq_addr &result) |
Parse a text address representation, returning an ALSA address record. 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... | |
Protected Member Functions | |
void | doEvents () |
Dispatch the events received from the Sequencer. More... | |
void | applyClientInfo () |
This internal method applies the ClientInfo data to the ALSA sequencer client. | |
void | readClients () |
Reads the ALSA sequencer's clients list. | |
void | freeClients () |
Releases the list of ALSA sequencer's clients. | |
void | updateAvailablePorts () |
Update the internal lists of user ports. | |
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... | |
const char * | _getDeviceName () |
Gets the internal sequencer device 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... | |
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... | |
Client management.
This class represents an ALSA sequencer client
Definition at line 198 of file alsaclient.h.
MidiClient | ( | QObject * | parent = 0 | ) |
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.
parent | The optional parent object |
Definition at line 366 of file alsaclient.cpp.
|
virtual |
Destructor.
The ports and queue associated to this client are automatically released.
Definition at line 384 of file alsaclient.cpp.
References MidiClient::close(), MidiClient::detachAllPorts(), MidiClient::freeClients(), and MidiClient::stopSequencerInput().
|
protected |
Gets the internal sequencer device name.
Definition at line 1621 of file alsaclient.cpp.
|
protected |
Sets the client name.
name | The new client name. |
Definition at line 1631 of file alsaclient.cpp.
References CHECK_WARNING.
void addEventFilter | ( | int | evtype | ) |
Add an event filter to the client.
evtype | An event filter to be added. |
Definition at line 982 of file alsaclient.cpp.
void addListener | ( | QObject * | listener | ) |
Adds a QObject to the listeners list.
This object should override the method QObject::customEvent() to receive SequencerEvent instances.
listener | A QObject listener to be notified of received events. |
Definition at line 1342 of file alsaclient.cpp.
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 502 of file alsaclient.cpp.
References CHECK_WARNING, and MidiClient::stopSequencerInput().
Referenced by MidiClient::~MidiClient().
|
protected |
Subscribe one port from another arbitrary sequencer client:port.
myport | The number of the internal port. |
client | The external client's identifier. |
port | The external port's identifier. |
Definition at line 1669 of file alsaclient.cpp.
References CHECK_WARNING.
|
protected |
Subscribe one port to another arbitrary sequencer client:port.
myport | The number of the internal port. |
client | The external client's identifier. |
port | The external port's identifier. |
Definition at line 1681 of file alsaclient.cpp.
References CHECK_WARNING.
MidiPort * createPort | ( | ) |
Create and attach a new MidiPort instance to this client.
Definition at line 915 of file alsaclient.cpp.
References MidiPort::attach().
MidiQueue * createQueue | ( | ) |
Create and return a new MidiQueue associated to this client.
Definition at line 1162 of file alsaclient.cpp.
Referenced by MidiClient::getQueue().
MidiQueue * createQueue | ( | QString const & | queueName | ) |
Create and return a new MidiQueue with the given name, associated to this client.
queueName | The name for the new queue. |
Definition at line 1178 of file alsaclient.cpp.
|
protected |
Create an ALSA sequencer port, without using MidiPort.
name | The name of the new port. |
caps | The new port capabilities. |
type | The type of the new port. |
Definition at line 1644 of file alsaclient.cpp.
References CHECK_WARNING.
|
protected |
Remove an ALSA sequencer port.
port | The numeric identifier of the port. |
Definition at line 1657 of file alsaclient.cpp.
References CHECK_WARNING.
|
protected |
Unsubscribe one port from another arbitrary sequencer client:port.
myport | The number of the internal port. |
client | The external client's identifier. |
port | The external port's identifier. |
Definition at line 1693 of file alsaclient.cpp.
References CHECK_WARNING.
|
protected |
Unsubscribe one port to another arbitrary sequencer client:port.
myport | The number of the internal port. |
client | The external client's identifier. |
port | The external port's identifier. |
Definition at line 1705 of file alsaclient.cpp.
References CHECK_WARNING.
|
protected |
Dispatch the events received from the Sequencer.
There are three methods of events delivering:
Definition at line 638 of file alsaclient.cpp.
References MidiClient::eventReceived(), and SequencerEventHandler::handleSequencerEvent().
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.
async | Use asynchronous mode. If false, this call will block until the buffer can be flushed. |
timeout | The maximum time to wait in synchronous mode. |
Definition at line 1115 of file alsaclient.cpp.
References CHECK_WARNING.
void dropInput | ( | ) |
Clears the client's input buffer and and remove events in sequencer queue.
Definition at line 1460 of file alsaclient.cpp.
References CHECK_WARNING.
void dropInputBuffer | ( | ) |
Remove all events on user-space input buffer.
Definition at line 1470 of file alsaclient.cpp.
References CHECK_WARNING.
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.
Definition at line 1483 of file alsaclient.cpp.
References CHECK_WARNING.
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.
Definition at line 1496 of file alsaclient.cpp.
References CHECK_WARNING.
SequencerEvent * extractOutput | ( | ) |
Extracts (and removes) the first event in the output buffer.
Definition at line 1518 of file alsaclient.cpp.
References CHECK_WARNING.
|
protected |
Gets a list of the available user ports in the system, filtered by the given bitmap of desired capabilities.
filter | A bitmap of capabilities. |
Definition at line 1270 of file alsaclient.cpp.
References PortInfo::getCapability(), ClientInfo::getClientId(), ClientInfo::getPorts(), and MidiClient::readClients().
Referenced by MidiClient::updateAvailablePorts().
ClientInfoList getAvailableClients | ( | ) |
Gets the list of clients from the ALSA sequencer.
Definition at line 814 of file alsaclient.cpp.
References MidiClient::readClients().
PortInfoList getAvailableInputs | ( | ) |
Gets the available user input ports in the system.
Definition at line 1316 of file alsaclient.cpp.
References MidiClient::updateAvailablePorts().
PortInfoList getAvailableOutputs | ( | ) |
Gets the available user output ports in the system.
Definition at line 1328 of file alsaclient.cpp.
References MidiClient::updateAvailablePorts().
QList< int > getAvailableQueues | ( | ) |
Get a list of the existing queues.
Definition at line 1246 of file alsaclient.cpp.
References SystemInfo::getMaxQueues(), and MidiClient::getSystemInfo().
bool getBroadcastFilter | ( | ) |
Gets the broadcast filter usage of the client.
Definition at line 993 of file alsaclient.cpp.
References ClientInfo::getBroadcastFilter().
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.
Definition at line 602 of file alsaclient.cpp.
References CHECK_WARNING.
Referenced by MidiClient::portDetach(), ClientInfo::readPorts(), and SequencerOutputThread::sendEchoEvent().
QString getClientName | ( | ) |
Gets the client's public name.
Definition at line 863 of file alsaclient.cpp.
References ClientInfo::getName().
Referenced by MidiPort::getReadSubscribers(), and MidiPort::getWriteSubscribers().
QString getClientName | ( | const int | clientId | ) |
Gets the public name corresponding to the given Client ID.
clientId | The ID of any existing sequencer client |
Definition at line 874 of file alsaclient.cpp.
References MidiClient::readClients().
bool getErrorBounce | ( | ) |
Get the error-bounce usage of the client.
Definition at line 1016 of file alsaclient.cpp.
References ClientInfo::getErrorBounce().
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.
Definition at line 550 of file alsaclient.cpp.
Referenced by MidiClient::setInputBufferSize().
MidiPortList getMidiPorts | ( | ) | const |
Gets the list of MidiPort instances belonging to this client.
Definition at line 905 of file alsaclient.cpp.
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.
Definition at line 520 of file alsaclient.cpp.
Referenced by MidiClient::setOutputBufferSize().
|
protected |
Returns the number of poll descriptors.
events | Poll events to be checked (POLLIN and POLLOUT). |
Definition at line 1575 of file alsaclient.cpp.
PoolInfo & getPoolInfo | ( | ) |
Gets a PoolInfo instance with an updated state of the client memory pool.
Definition at line 1388 of file alsaclient.cpp.
MidiQueue * getQueue | ( | ) |
Get the MidiQueue instance associated to this client.
If the client is not associated to a MidiQueue, one is created.
Definition at line 1149 of file alsaclient.cpp.
References MidiClient::createQueue().
Referenced by SequencerOutputThread::SequencerOutputThread().
int getQueueId | ( | const QString & | name | ) |
Gets the queue's numeric identifier corresponding to the provided name.
name | The name string to query. |
Definition at line 1564 of file alsaclient.cpp.
Referenced by MidiClient::useQueue().
snd_seq_type_t getSequencerType | ( | ) |
Returns the type snd_seq_type_t of the given sequencer handle.
Definition at line 612 of file alsaclient.cpp.
SystemInfo & getSystemInfo | ( | ) |
Gets a SystemInfo instance with the updated state of the system.
Definition at line 1377 of file alsaclient.cpp.
Referenced by MidiClient::getAvailableQueues().
ClientInfo & getThisClientInfo | ( | ) |
Gets the ClientInfo object holding data about this client.
Definition at line 827 of file alsaclient.cpp.
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.
fetch | Check and fetch the sequencer input pool. |
Definition at line 1552 of file alsaclient.cpp.
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.
deviceName | the 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. |
openMode | the open mode, default value = SND_SEQ_OPEN_DUPLEX. The read/write mode of the sequencer. Can be one of these three values:
|
blockMode | open in blocking mode, default value = false. |
Definition at line 445 of file alsaclient.cpp.
References CHECK_ERROR, and CHECK_WARNING.
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.
conf | a configuration object pointer. |
deviceName | the 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. |
openMode | the open mode, default value = SND_SEQ_OPEN_DUPLEX. The read/write mode of the sequencer. Can be one of these three values:
|
blockMode | open in blocking mode, default value = false. |
Definition at line 478 of file alsaclient.cpp.
References CHECK_ERROR, and CHECK_WARNING.
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.
ev | The event to be sent. |
async | Use asynchronous mode. If false, this call will block until the event can be delivered. |
timeout | The maximum time to wait in synchronous mode. |
Definition at line 1045 of file alsaclient.cpp.
References CHECK_WARNING, and SequencerEvent::getHandle().
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.
ev | The event to be sent. |
Definition at line 1099 of file alsaclient.cpp.
References CHECK_WARNING, and SequencerEvent::getHandle().
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.
ev | The event to be sent. |
async | Use asynchronous mode. If false, this call will block until the event is delivered to the sequencer. |
timeout | The maximum time to wait in synchronous mode. |
Definition at line 1073 of file alsaclient.cpp.
References CHECK_WARNING, and SequencerEvent::getHandle().
Referenced by MidiQueue::setRealTimePosition(), and MidiQueue::setTickPosition().
int outputPending | ( | ) |
Returns the size of pending events on the output buffer.
Definition at line 1533 of file alsaclient.cpp.
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().
straddr | source text address representation |
addr | returned ALSA address record |
Definition at line 1722 of file alsaclient.cpp.
References ClientInfo::getClientId(), ClientInfo::getName(), and MidiClient::readClients().
Referenced by MidiPort::subscribeFrom(), MidiPort::subscribeTo(), MidiPort::unsubscribeFrom(), and MidiPort::unsubscribeTo().
|
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.
pfds | Array of poll descriptors |
space | Space in the poll descriptor array |
events | Polling events to be checked (POLLIN and POLLOUT) |
Definition at line 1594 of file alsaclient.cpp.
|
protected |
Gets the number of returned events from poll descriptors.
pfds | Array of poll descriptors. |
nfds | Count of poll descriptors. |
Definition at line 1607 of file alsaclient.cpp.
References CHECK_WARNING.
void portAttach | ( | MidiPort * | port | ) |
Attach a MidiPort instance to this client.
port | The MidiPort to be attached |
Definition at line 927 of file alsaclient.cpp.
References CHECK_ERROR.
Referenced by MidiPort::attach().
void portDetach | ( | MidiPort * | port | ) |
Detach a MidiPort instance from this client.
port | The MidiPort to be detached |
Definition at line 940 of file alsaclient.cpp.
References CHECK_ERROR, PortInfo::getClient(), MidiClient::getClientId(), PortInfo::getPort(), MidiPort::getPortInfo(), and MidiPort::setMidiClient().
Referenced by MidiPort::detach().
bool realTimeInputEnabled | ( | ) |
Return the real-time priority setting for the MIDI input thread.
Definition at line 417 of file alsaclient.cpp.
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.
spec | A RemoveEvents instance specifying the removal condition. |
Definition at line 1508 of file alsaclient.cpp.
References CHECK_WARNING.
void removeListener | ( | QObject * | listener | ) |
Removes a QObject listener from the listeners list.
listener | listener A QObject listener to be removed of received events. |
Definition at line 1353 of file alsaclient.cpp.
void resetPoolInput | ( | ) |
Resets the client input pool.
Definition at line 1410 of file alsaclient.cpp.
References CHECK_WARNING.
void resetPoolOutput | ( | ) |
Resets the client output pool.
Definition at line 1420 of file alsaclient.cpp.
References CHECK_WARNING.
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.
newValue | the blocking mode |
Definition at line 581 of file alsaclient.cpp.
References CHECK_WARNING.
void setBroadcastFilter | ( | bool | newValue | ) |
Sets the broadcast filter usage of the client.
newValue | The broadcast filter. |
Definition at line 1004 of file alsaclient.cpp.
References MidiClient::applyClientInfo(), and ClientInfo::setBroadcastFilter().
void setClientName | ( | QString const & | newName | ) |
Changes the public name of the ALSA sequencer client.
newName | A new public name |
Definition at line 892 of file alsaclient.cpp.
References MidiClient::applyClientInfo(), ClientInfo::getName(), and ClientInfo::setName().
void setErrorBounce | ( | bool | newValue | ) |
Sets the error-bounce usage of the client.
newValue | The error-bounce usage. |
Definition at line 1027 of file alsaclient.cpp.
References MidiClient::applyClientInfo(), and ClientInfo::setErrorBounce().
void setEventsEnabled | ( | const bool | bEnabled | ) |
Enables the notification of received SequencerEvent instances to the listeners registered with addListener()
bEnabled | The new state of the events delivering mode. |
Definition at line 1365 of file alsaclient.cpp.
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.
newSize | the size of the library input buffer |
Definition at line 564 of file alsaclient.cpp.
References CHECK_WARNING, and MidiClient::getInputBufferSize().
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.
newSize | the size of the library output buffer |
Definition at line 534 of file alsaclient.cpp.
References CHECK_WARNING, and MidiClient::getOutputBufferSize().
void setPoolInfo | ( | const PoolInfo & | info | ) |
Applies (updates) the client's PoolInfo data into the system.
info | The PoolInfo reference to be applied to the client. |
Definition at line 1399 of file alsaclient.cpp.
References CHECK_WARNING.
void setPoolInput | ( | int | size | ) |
Sets the size of the client's input pool.
size | The new size |
Definition at line 1430 of file alsaclient.cpp.
References CHECK_WARNING.
void setPoolOutput | ( | int | size | ) |
Sets the size of the client's output pool.
size | The new size |
Definition at line 1440 of file alsaclient.cpp.
References CHECK_WARNING.
void setPoolOutputRoom | ( | int | size | ) |
Sets the room size of the client's output pool.
size | The new size |
Definition at line 1450 of file alsaclient.cpp.
References CHECK_WARNING.
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.
enable | real-time priority enabled |
Definition at line 404 of file alsaclient.cpp.
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.
val | a ClientInfo object reference |
Definition at line 841 of file alsaclient.cpp.
void synchronizeOutput | ( | ) |
Wait until all sent events are processed.
This function waits until all events of this client are processed.
Definition at line 1138 of file alsaclient.cpp.
MidiQueue * useQueue | ( | int | queue_id | ) |
Create a new MidiQueue instance using a queue already existing in the system, associating it to the client.
queue_id | An existing queue identifier. |
Definition at line 1195 of file alsaclient.cpp.
MidiQueue * useQueue | ( | const QString & | name | ) |
Create a new MidiQueue instance using a queue already existing in the system, associating it to the client.
name | An existing queue name. |
Definition at line 1212 of file alsaclient.cpp.
References MidiClient::getQueueId().
Associate an existing MidiQueue instance to the client.
queue | An existing MidiQueue. |
Definition at line 1231 of file alsaclient.cpp.