drumstick 0.5.0
|
Port management. More...
#include <alsaport.h>
Signals | |
void | subscribed (MidiPort *port, Subscription *subs) |
Signal emitted when an internal subscription is done. | |
void | midiClientChanged (MidiPort *port, MidiClient *seq) |
Signal emitted when the MidiClient has changed. | |
void | attached (MidiPort *port) |
Signal emitted when the port is attached to a MidiClient. | |
void | detached (MidiPort *port) |
Signal emitted when the port is detached from a MidiClient. | |
Public Member Functions | |
MidiPort (QObject *parent=0) | |
Constructor. | |
virtual | ~MidiPort () |
Destructor. | |
void | attach (MidiClient *seq) |
Attach the port to a MidiClient instance. | |
void | detach () |
Detach the port from any MidiClient instance previously attached. | |
void | subscribe (Subscription *subs) |
Subscribe a Subscription object. | |
void | unsubscribe (Subscription *subs) |
Unsubscribe a Subscription object. | |
void | unsubscribeAll () |
Unsubscribe all subscriptions. | |
void | unsubscribeTo (QString const &name) |
Unsubscribe a destination port. | |
void | unsubscribeTo (PortInfo *port) |
Unsubscribe a destination port. | |
void | unsubscribeTo (const snd_seq_addr_t *addr) |
Unsubscribe a destination port. | |
void | unsubscribeFrom (QString const &name) |
Unsubscribe a source port. | |
void | unsubscribeFrom (PortInfo *port) |
Unsubscribe a source port. | |
void | unsubscribeFrom (const snd_seq_addr_t *addr) |
Unsubscribe a source port. | |
void | subscribeTo (PortInfo *port) |
Subscribe to another port destination. | |
void | subscribeTo (int client, int port) |
Susbcribe to another port destination. | |
void | subscribeTo (QString const &name) |
Subscribe to another port destination. | |
void | subscribeFrom (PortInfo *port) |
Subscribe a source port. | |
void | subscribeFrom (int client, int port) |
Subscribe a source port. | |
void | subscribeFrom (QString const &name) |
Subscribe a source port. | |
void | subscribeFromAnnounce () |
Subscribe from the System:announce port. | |
void | updateSubscribers () |
Update the subscribers list in the PortInfo member. | |
SubscriptionsList | getSubscriptions () const |
Gets the list of susbcriptions. | |
PortInfoList | getReadSubscribers () |
Gets the list of read subscribers. | |
PortInfoList | getWriteSubscribers () |
Gets the list of write subscribers. | |
void | updateConnectionsTo (const PortInfoList &desired) |
Update the write subscriptions. | |
void | updateConnectionsFrom (const PortInfoList &desired) |
Update the read susbcriptions. | |
void | applyPortInfo () |
Applies all the the delayed PortInfo changes to the MIDI port object. | |
QString | getPortName () |
Gets the port name. | |
void | setPortName (QString const &newName) |
Sets the port name. | |
int | getPortId () |
Gets the port number. | |
unsigned int | getCapability () |
Gets the port capabilities. | |
void | setCapability (unsigned int newValue) |
Sets the port capabilities. | |
unsigned int | getPortType () |
Gets the port type. | |
void | setPortType (unsigned int newValue) |
Sets the port type bitmap. | |
int | getMidiChannels () |
Gets the MIDI channels. | |
void | setMidiChannels (int newValue) |
Sets the MIDI channels. | |
int | getMidiVoices () |
Gets the MIDI voices. | |
void | setMidiVoices (int newValue) |
Sets the MIDI voices. | |
int | getSynthVoices () |
Gets the synth voices. | |
void | setSynthVoices (int newValue) |
Sets the synth voices. | |
bool | getTimestamping () |
Gets the timestamping mode. | |
bool | getTimestampReal () |
Gets the timestamp real mode. | |
int | getTimestampQueue () |
Gets the timestamp queue number. | |
void | setTimestamping (bool value) |
Sets the timestamping mode. | |
void | setTimestampReal (bool value) |
Sets the timestamp real mode. | |
void | setTimestampQueue (int queueId) |
Sets the timestamp queue number. | |
Static Public Member Functions | |
static bool | containsAddress (const snd_seq_addr_t *addr, const PortInfoList &lst) |
Checks if the provided address is included in the port list. | |
Protected Member Functions | |
PortInfo * | getPortInfo () |
Gets the PortInfo object pointer. | |
void | freeSubscriptions () |
Releases the lists of subscriptions. | |
void | setMidiClient (MidiClient *seq) |
Sets the MidiClient. | |
Port management.
This class represents an ALSA sequencer port.
Definition at line 119 of file alsaport.h.
Constructor.
parent | An optional parent object |
Definition at line 549 of file alsaport.cpp.
Referenced by attached(), detached(), midiClientChanged(), and subscribed().
|
virtual |
Destructor.
All subscriptions are released.
Definition at line 560 of file alsaport.cpp.
References detach(), freeSubscriptions(), and unsubscribeAll().
void attach | ( | MidiClient * | seq | ) |
Attach the port to a MidiClient instance.
seq | A MidiClient object pointer |
Definition at line 1097 of file alsaport.cpp.
References attached(), and MidiClient::portAttach().
Referenced by MidiClient::createPort().
|
signal |
Signal emitted when the port is attached to a MidiClient.
port | MIDI port object pointer |
References MidiPort().
Referenced by attach().
|
static |
Checks if the provided address is included in the port list.
addr | ALSA address record pointer |
lst | List of port information containers |
Definition at line 1186 of file alsaport.cpp.
References PortInfo::getAddr().
Referenced by updateConnectionsFrom(), and updateConnectionsTo().
|
signal |
Signal emitted when the port is detached from a MidiClient.
port | MIDI port object pointer |
References freeSubscriptions(), getPortInfo(), MidiPort(), and setMidiClient().
Referenced by detach().
unsigned int getCapability | ( | ) |
Gets the port capabilities.
Definition at line 926 of file alsaport.cpp.
int getMidiChannels | ( | ) |
int getMidiVoices | ( | ) |
int getPortId | ( | ) |
QString getPortName | ( | ) |
unsigned int getPortType | ( | ) |
Gets the port type.
Definition at line 949 of file alsaport.cpp.
PortInfoList getReadSubscribers | ( | ) |
Gets the list of read subscribers.
Definition at line 1134 of file alsaport.cpp.
References Subscriber::getAddr(), PortInfo::getCapability(), and PortInfo::setClientName().
Referenced by updateConnectionsTo().
SubscriptionsList getSubscriptions | ( | ) | const |
Gets the list of susbcriptions.
Definition at line 581 of file alsaport.cpp.
int getSynthVoices | ( | ) |
bool getTimestamping | ( | ) |
Gets the timestamping mode.
Definition at line 1034 of file alsaport.cpp.
int getTimestampQueue | ( | ) |
Gets the timestamp queue number.
Definition at line 1054 of file alsaport.cpp.
bool getTimestampReal | ( | ) |
Gets the timestamp real mode.
Definition at line 1044 of file alsaport.cpp.
PortInfoList getWriteSubscribers | ( | ) |
Gets the list of write subscribers.
Definition at line 1159 of file alsaport.cpp.
References Subscriber::getAddr(), PortInfo::getCapability(), and PortInfo::setClientName().
Referenced by updateConnectionsFrom().
|
signal |
Signal emitted when the MidiClient has changed.
port | MIDI port object pinter |
seq | MidiClient object pointer |
References MidiPort().
Referenced by setMidiClient().
void setCapability | ( | unsigned int | newValue | ) |
Sets the port capabilities.
newValue | The capabilities bitmap |
Definition at line 937 of file alsaport.cpp.
References applyPortInfo().
void setMidiChannels | ( | int | newValue | ) |
Sets the MIDI channels.
newValue | The MIDI channels |
Definition at line 981 of file alsaport.cpp.
References applyPortInfo().
|
protected |
Sets the MidiClient.
seq | A MidiClient object pointer |
Definition at line 600 of file alsaport.cpp.
References applyPortInfo(), and midiClientChanged().
Referenced by detached(), and MidiClient::portDetach().
void setMidiVoices | ( | int | newValue | ) |
Sets the MIDI voices.
newValue | The MIDI voices |
Definition at line 1002 of file alsaport.cpp.
References applyPortInfo().
void setPortName | ( | QString const & | newName | ) |
Sets the port name.
newName | The new port name |
Definition at line 904 of file alsaport.cpp.
References applyPortInfo().
void setPortType | ( | unsigned int | newValue | ) |
Sets the port type bitmap.
newValue | The port type flags bitmap |
Definition at line 960 of file alsaport.cpp.
References applyPortInfo().
void setSynthVoices | ( | int | newValue | ) |
Sets the synth voices.
newValue | The synth voices |
Definition at line 1023 of file alsaport.cpp.
References applyPortInfo().
void setTimestamping | ( | bool | value | ) |
Sets the timestamping mode.
value | The timestamping mode |
Definition at line 1064 of file alsaport.cpp.
References applyPortInfo().
void setTimestampQueue | ( | int | queueId | ) |
Sets the timestamp queue number.
queueId | The queue number |
Definition at line 1086 of file alsaport.cpp.
References applyPortInfo().
void setTimestampReal | ( | bool | value | ) |
Sets the timestamp real mode.
value | The timestamp real mode |
Definition at line 1075 of file alsaport.cpp.
References applyPortInfo().
void subscribe | ( | Subscription * | subs | ) |
Subscribe a Subscription object.
subs | A Subscription object pointer |
Definition at line 615 of file alsaport.cpp.
References Subscription::subscribe(), and subscribed().
Referenced by subscribeFrom(), subscribeFrom(), subscribeFrom(), subscribeTo(), subscribeTo(), and subscribeTo().
|
signal |
Signal emitted when an internal subscription is done.
port | MIDI port object pointer |
subs | Subscription object pointer |
References MidiPort().
Referenced by subscribe().
void subscribeFrom | ( | int | client, |
int | port ) |
Subscribe a source port.
client | ALSA client number |
port | ALSA port number |
Definition at line 769 of file alsaport.cpp.
References Subscription::setDest(), Subscription::setSender(), and subscribe().
void subscribeFrom | ( | PortInfo * | port | ) |
Subscribe a source port.
port | A PortInfo object pointer |
Definition at line 755 of file alsaport.cpp.
References PortInfo::getAddr(), Subscription::setDest(), Subscription::setSender(), and subscribe().
Referenced by subscribeFromAnnounce(), and updateConnectionsFrom().
void subscribeFrom | ( | QString const & | name | ) |
Subscribe a source port.
name | A string representing a client:port pair |
Definition at line 785 of file alsaport.cpp.
References Subscription::setDest(), Subscription::setSender(), and subscribe().
void subscribeTo | ( | int | client, |
int | port ) |
Susbcribe to another port destination.
client | ALSA client number |
port | ALSA port number |
Definition at line 669 of file alsaport.cpp.
References Subscription::setDest(), Subscription::setSender(), and subscribe().
void subscribeTo | ( | PortInfo * | info | ) |
Subscribe to another port destination.
info | A PortInfo object pointer |
Definition at line 655 of file alsaport.cpp.
References PortInfo::getAddr(), Subscription::setDest(), Subscription::setSender(), and subscribe().
Referenced by updateConnectionsTo().
void subscribeTo | ( | QString const & | name | ) |
Subscribe to another port destination.
name | A string representing a client:port pair |
Definition at line 685 of file alsaport.cpp.
References Subscription::setDest(), Subscription::setSender(), and subscribe().
void unsubscribe | ( | Subscription * | subs | ) |
Unsubscribe a Subscription object.
subs | A Subscription object pointer |
Definition at line 627 of file alsaport.cpp.
References Subscription::getDest(), Subscription::getSender(), and Subscription::unsubscribe().
Referenced by unsubscribeFrom(), unsubscribeFrom(), unsubscribeFrom(), unsubscribeTo(), unsubscribeTo(), and unsubscribeTo().
void unsubscribeFrom | ( | const snd_seq_addr_t * | addr | ) |
Unsubscribe a source port.
addr | An ALSA address record pointer |
Definition at line 839 of file alsaport.cpp.
References Subscription::setDest(), Subscription::setSender(), and unsubscribe().
void unsubscribeFrom | ( | PortInfo * | port | ) |
Unsubscribe a source port.
port | A PortInfo object pointer |
Definition at line 823 of file alsaport.cpp.
References PortInfo::getAddr(), Subscription::setDest(), Subscription::setSender(), and unsubscribe().
void unsubscribeFrom | ( | QString const & | name | ) |
Unsubscribe a source port.
name | A string representing a client:port pair |
Definition at line 804 of file alsaport.cpp.
References Subscription::setDest(), Subscription::setSender(), and unsubscribe().
Referenced by updateConnectionsFrom().
void unsubscribeTo | ( | const snd_seq_addr_t * | addr | ) |
Unsubscribe a destination port.
addr | An ALSA address record pointer |
Definition at line 739 of file alsaport.cpp.
References Subscription::setDest(), Subscription::setSender(), and unsubscribe().
void unsubscribeTo | ( | PortInfo * | port | ) |
Unsubscribe a destination port.
port | A PortInfo object pointer |
Definition at line 723 of file alsaport.cpp.
References PortInfo::getAddr(), Subscription::setDest(), Subscription::setSender(), and unsubscribe().
void unsubscribeTo | ( | QString const & | name | ) |
Unsubscribe a destination port.
name | A string representing a client:port pair |
Definition at line 704 of file alsaport.cpp.
References Subscription::setDest(), Subscription::setSender(), and unsubscribe().
Referenced by updateConnectionsTo().
void updateConnectionsFrom | ( | const PortInfoList & | ports | ) |
Update the read susbcriptions.
ports | List of readable ports to be subscribed |
Definition at line 1227 of file alsaport.cpp.
References containsAddress(), PortInfo::getAddr(), getWriteSubscribers(), subscribeFrom(), and unsubscribeFrom().
void updateConnectionsTo | ( | const PortInfoList & | ports | ) |
Update the write subscriptions.
ports | List of writable ports to be subscribed |
Definition at line 1204 of file alsaport.cpp.
References containsAddress(), PortInfo::getAddr(), getReadSubscribers(), subscribeTo(), and unsubscribeTo().