![]() |
drumstick 2.10.0
C++ MIDI libraries using Qt objects, idioms, and style.
|
Port management. More...
#include <alsaport.h>

Signals | |
| void | subscribed (drumstick::ALSA::MidiPort *port, drumstick::ALSA::Subscription *subs) |
| Signal emitted when an internal subscription is done. More... | |
| void | midiClientChanged (drumstick::ALSA::MidiPort *port, drumstick::ALSA::MidiClient *seq) |
| Signal emitted when the MidiClient has changed. More... | |
| void | attached (drumstick::ALSA::MidiPort *port) |
| Signal emitted when the port is attached to a MidiClient. More... | |
| void | detached (drumstick::ALSA::MidiPort *port) |
| Signal emitted when the port is detached from a MidiClient. More... | |
Public Member Functions | |
| MidiPort (QObject *parent=nullptr) | |
| Constructor. More... | |
| virtual | ~MidiPort () |
| Destructor. More... | |
| void | attach (MidiClient *seq) |
| Attach the port to a MidiClient instance. More... | |
| void | detach () |
| Detach the port from any MidiClient instance previously attached. | |
| void | subscribe (Subscription *subs) |
| Subscribe a Subscription object. More... | |
| void | unsubscribe (Subscription *subs) |
| Unsubscribe a Subscription object. More... | |
| void | unsubscribeAll () |
| Unsubscribe all subscriptions. | |
| void | unsubscribeTo (QString const &name) |
| Unsubscribe a destination port. More... | |
| void | unsubscribeTo (PortInfo *port) |
| Unsubscribe a destination port. More... | |
| void | unsubscribeTo (const snd_seq_addr_t *addr) |
| Unsubscribe a destination port. More... | |
| void | unsubscribeFrom (QString const &name) |
| Unsubscribe a source port. More... | |
| void | unsubscribeFrom (PortInfo *port) |
| Unsubscribe a source port. More... | |
| void | unsubscribeFrom (const snd_seq_addr_t *addr) |
| Unsubscribe a source port. More... | |
| void | subscribeTo (PortInfo *port) |
| Subscribe to another port destination. More... | |
| void | subscribeTo (int client, int port) |
| Susbcribe to another port destination. More... | |
| void | subscribeTo (QString const &name) |
| Subscribe to another port destination. More... | |
| void | subscribeFrom (PortInfo *port) |
| Subscribe a source port. More... | |
| void | subscribeFrom (int client, int port) |
| Subscribe a source port. More... | |
| void | subscribeFrom (QString const &name) |
| Subscribe a source port. More... | |
| 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. More... | |
| PortInfoList | getReadSubscribers () |
| Gets the list of read subscribers. More... | |
| PortInfoList | getWriteSubscribers () |
| Gets the list of write subscribers. More... | |
| void | updateConnectionsTo (const PortInfoList &desired) |
| Update the write subscriptions. More... | |
| void | updateConnectionsFrom (const PortInfoList &desired) |
| Update the read susbcriptions. More... | |
| void | applyPortInfo () |
| Applies all the the delayed PortInfo changes to the MIDI port object. | |
| QString | getPortName () |
| Gets the port name. More... | |
| void | setPortName (QString const &newName) |
| Sets the port name. More... | |
| int | getPortId () |
| Gets the port number. More... | |
| unsigned int | getCapability () |
| Gets the port capabilities. More... | |
| void | setCapability (unsigned int newValue) |
| Sets the port capabilities. More... | |
| unsigned int | getPortType () |
| Gets the port type. More... | |
| void | setPortType (unsigned int newValue) |
| Sets the port type bitmap. More... | |
| int | getMidiChannels () |
| Gets the MIDI channels. More... | |
| void | setMidiChannels (int newValue) |
| Sets the MIDI channels. More... | |
| int | getMidiVoices () |
| Gets the MIDI voices. More... | |
| void | setMidiVoices (int newValue) |
| Sets the MIDI voices. More... | |
| int | getSynthVoices () |
| Gets the synth voices. More... | |
| void | setSynthVoices (int newValue) |
| Sets the synth voices. More... | |
| bool | getTimestamping () |
| Gets the timestamping mode. More... | |
| bool | getTimestampReal () |
| Gets the timestamp real mode. More... | |
| int | getTimestampQueue () |
| Gets the timestamp queue number. More... | |
| void | setTimestamping (bool value) |
| Sets the timestamping mode. More... | |
| void | setTimestampReal (bool value) |
| Sets the timestamp real mode. More... | |
| void | setTimestampQueue (int queueId) |
| Sets the timestamp queue number. More... | |
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. More... | |
Protected Member Functions | |
| PortInfo * | getPortInfo () |
| Gets the PortInfo object pointer. More... | |
| void | freeSubscriptions () |
| Releases the lists of subscriptions. | |
| void | setMidiClient (MidiClient *seq) |
| Sets the MidiClient. More... | |
Port management.
This class represents an ALSA sequencer port.
Definition at line 124 of file alsaport.h.
Constructor.
| parent | An optional parent object |
Definition at line 574 of file alsaport.cpp.
|
virtual |
Destructor.
All subscriptions are released.
Definition at line 585 of file alsaport.cpp.
References MidiPort::detach(), MidiPort::freeSubscriptions(), and MidiPort::unsubscribeAll().
| void attach | ( | MidiClient * | seq | ) |
Attach the port to a MidiClient instance.
| seq | A MidiClient object pointer |
Definition at line 1126 of file alsaport.cpp.
References MidiPort::attached(), and MidiClient::portAttach().
Referenced by MidiClient::createPort().
|
signal |
Signal emitted when the port is attached to a MidiClient.
| port | MIDI port object pointer |
Referenced by MidiPort::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 1215 of file alsaport.cpp.
References PortInfo::getAddr().
Referenced by MidiPort::updateConnectionsFrom(), and MidiPort::updateConnectionsTo().
|
signal |
Signal emitted when the port is detached from a MidiClient.
| port | MIDI port object pointer |
Referenced by MidiPort::detach().
| unsigned int getCapability | ( | ) |
Gets the port capabilities.
Definition at line 955 of file alsaport.cpp.
References PortInfo::getCapability().
| int getMidiChannels | ( | ) |
Gets the MIDI channels.
Definition at line 1000 of file alsaport.cpp.
References PortInfo::getMidiChannels().
| int getMidiVoices | ( | ) |
Gets the MIDI voices.
Definition at line 1021 of file alsaport.cpp.
References PortInfo::getMidiVoices().
| int getPortId | ( | ) |
Gets the port number.
Definition at line 944 of file alsaport.cpp.
References PortInfo::getPort().
|
protected |
Gets the PortInfo object pointer.
Definition at line 597 of file alsaport.cpp.
Referenced by MidiClient::detachAllPorts(), and MidiClient::portDetach().
| QString getPortName | ( | ) |
Gets the port name.
Definition at line 923 of file alsaport.cpp.
References PortInfo::getName().
| unsigned int getPortType | ( | ) |
Gets the port type.
Definition at line 978 of file alsaport.cpp.
References PortInfo::getType().
| PortInfoList getReadSubscribers | ( | ) |
Gets the list of read subscribers.
Definition at line 1163 of file alsaport.cpp.
References Subscriber::getAddr(), PortInfo::getCapability(), PortInfo::getClient(), MidiClient::getClientName(), PortInfo::getReadSubscribers(), and PortInfo::setClientName().
Referenced by MidiPort::updateConnectionsTo().
| SubscriptionsList getSubscriptions | ( | ) | const |
Gets the list of susbcriptions.
Definition at line 607 of file alsaport.cpp.
| int getSynthVoices | ( | ) |
Gets the synth voices.
Definition at line 1042 of file alsaport.cpp.
References PortInfo::getSynthVoices().
| bool getTimestamping | ( | ) |
Gets the timestamping mode.
Definition at line 1063 of file alsaport.cpp.
References PortInfo::getTimestamping().
| int getTimestampQueue | ( | ) |
Gets the timestamp queue number.
Definition at line 1083 of file alsaport.cpp.
References PortInfo::getTimestampQueue().
| bool getTimestampReal | ( | ) |
Gets the timestamp real mode.
Definition at line 1073 of file alsaport.cpp.
References PortInfo::getTimestampReal().
| PortInfoList getWriteSubscribers | ( | ) |
Gets the list of write subscribers.
Definition at line 1188 of file alsaport.cpp.
References Subscriber::getAddr(), PortInfo::getCapability(), PortInfo::getClient(), MidiClient::getClientName(), PortInfo::getWriteSubscribers(), and PortInfo::setClientName().
Referenced by MidiPort::updateConnectionsFrom().
|
signal |
Signal emitted when the MidiClient has changed.
| port | MIDI port object pinter |
| seq | MidiClient object pointer |
Referenced by MidiPort::setMidiClient().
| void setCapability | ( | unsigned int | newValue | ) |
Sets the port capabilities.
| newValue | The capabilities bitmap |
Definition at line 966 of file alsaport.cpp.
References MidiPort::applyPortInfo(), and PortInfo::setCapability().
| void setMidiChannels | ( | int | newValue | ) |
Sets the MIDI channels.
| newValue | The MIDI channels |
Definition at line 1010 of file alsaport.cpp.
References MidiPort::applyPortInfo(), and PortInfo::setMidiChannels().
|
protected |
Sets the MidiClient.
| seq | A MidiClient object pointer |
Definition at line 626 of file alsaport.cpp.
References MidiPort::applyPortInfo(), and MidiPort::midiClientChanged().
Referenced by MidiClient::detachAllPorts(), and MidiClient::portDetach().
| void setMidiVoices | ( | int | newValue | ) |
Sets the MIDI voices.
| newValue | The MIDI voices |
Definition at line 1031 of file alsaport.cpp.
References MidiPort::applyPortInfo(), and PortInfo::setMidiVoices().
| void setPortName | ( | QString const & | newName | ) |
Sets the port name.
| newName | The new port name |
Definition at line 933 of file alsaport.cpp.
References MidiPort::applyPortInfo(), and PortInfo::setName().
| void setPortType | ( | unsigned int | newValue | ) |
Sets the port type bitmap.
| newValue | The port type flags bitmap |
Definition at line 989 of file alsaport.cpp.
References MidiPort::applyPortInfo(), and PortInfo::setType().
| void setSynthVoices | ( | int | newValue | ) |
Sets the synth voices.
| newValue | The synth voices |
Definition at line 1052 of file alsaport.cpp.
References MidiPort::applyPortInfo(), and PortInfo::setSynthVoices().
| void setTimestamping | ( | bool | value | ) |
Sets the timestamping mode.
| value | The timestamping mode |
Definition at line 1093 of file alsaport.cpp.
References MidiPort::applyPortInfo(), and PortInfo::setTimestamping().
| void setTimestampQueue | ( | int | queueId | ) |
Sets the timestamp queue number.
| queueId | The queue number |
Definition at line 1115 of file alsaport.cpp.
References MidiPort::applyPortInfo(), and PortInfo::setTimestampQueue().
| void setTimestampReal | ( | bool | value | ) |
Sets the timestamp real mode.
| value | The timestamp real mode |
Definition at line 1104 of file alsaport.cpp.
References MidiPort::applyPortInfo(), and PortInfo::setTimestampReal().
| void subscribe | ( | Subscription * | subs | ) |
Subscribe a Subscription object.
| subs | A Subscription object pointer |
Definition at line 641 of file alsaport.cpp.
References Subscription::clone(), Subscription::subscribe(), and MidiPort::subscribed().
Referenced by MidiPort::subscribeFrom(), and MidiPort::subscribeTo().
|
signal |
Signal emitted when an internal subscription is done.
It is recommended to use Qt::UniqueConnection with this signal.
| port | MIDI port object pointer |
| subs | Subscription object pointer. Receiver gets the ownership of the Subscription pointer. |
Referenced by MidiPort::subscribe().
| void subscribeFrom | ( | int | client, |
| int | port | ||
| ) |
Subscribe a source port.
Definition at line 798 of file alsaport.cpp.
References PortInfo::getAddr(), Subscription::setDest(), Subscription::setSender(), and MidiPort::subscribe().
| void subscribeFrom | ( | PortInfo * | port | ) |
Subscribe a source port.
| port | A PortInfo object pointer |
Definition at line 784 of file alsaport.cpp.
References PortInfo::getAddr(), Subscription::setDest(), Subscription::setSender(), and MidiPort::subscribe().
Referenced by MidiPort::subscribeFromAnnounce(), and MidiPort::updateConnectionsFrom().
| void subscribeFrom | ( | QString const & | name | ) |
Subscribe a source port.
| name | A string representing a client:port pair |
Definition at line 814 of file alsaport.cpp.
References PortInfo::getAddr(), MidiClient::getHandle(), MidiClient::parseAddress(), Subscription::setDest(), Subscription::setSender(), and MidiPort::subscribe().
| void subscribeTo | ( | int | client, |
| int | port | ||
| ) |
Susbcribe to another port destination.
Definition at line 698 of file alsaport.cpp.
References PortInfo::getAddr(), Subscription::setDest(), Subscription::setSender(), and MidiPort::subscribe().
| void subscribeTo | ( | PortInfo * | info | ) |
Subscribe to another port destination.
| info | A PortInfo object pointer |
Definition at line 684 of file alsaport.cpp.
References PortInfo::getAddr(), Subscription::setDest(), Subscription::setSender(), and MidiPort::subscribe().
Referenced by MidiPort::updateConnectionsTo().
| void subscribeTo | ( | QString const & | name | ) |
Subscribe to another port destination.
| name | A string representing a client:port pair |
Definition at line 714 of file alsaport.cpp.
References PortInfo::getAddr(), MidiClient::getHandle(), MidiClient::parseAddress(), Subscription::setDest(), Subscription::setSender(), and MidiPort::subscribe().
| void unsubscribe | ( | Subscription * | subs | ) |
Unsubscribe a Subscription object.
| subs | A Subscription object pointer |
Definition at line 656 of file alsaport.cpp.
References Subscription::getDest(), Subscription::getSender(), and Subscription::unsubscribe().
Referenced by MidiPort::unsubscribeFrom(), and MidiPort::unsubscribeTo().
| void unsubscribeFrom | ( | const snd_seq_addr_t * | addr | ) |
Unsubscribe a source port.
| addr | An ALSA address record pointer |
Definition at line 868 of file alsaport.cpp.
References PortInfo::getAddr(), MidiClient::getHandle(), Subscription::setDest(), Subscription::setSender(), and MidiPort::unsubscribe().
| void unsubscribeFrom | ( | PortInfo * | port | ) |
Unsubscribe a source port.
| port | A PortInfo object pointer |
Definition at line 852 of file alsaport.cpp.
References PortInfo::getAddr(), MidiClient::getHandle(), Subscription::setDest(), Subscription::setSender(), and MidiPort::unsubscribe().
| void unsubscribeFrom | ( | QString const & | name | ) |
Unsubscribe a source port.
| name | A string representing a client:port pair |
Definition at line 833 of file alsaport.cpp.
References PortInfo::getAddr(), MidiClient::getHandle(), MidiClient::parseAddress(), Subscription::setDest(), Subscription::setSender(), and MidiPort::unsubscribe().
Referenced by MidiPort::updateConnectionsFrom().
| void unsubscribeTo | ( | const snd_seq_addr_t * | addr | ) |
Unsubscribe a destination port.
| addr | An ALSA address record pointer |
Definition at line 768 of file alsaport.cpp.
References PortInfo::getAddr(), MidiClient::getHandle(), Subscription::setDest(), Subscription::setSender(), and MidiPort::unsubscribe().
| void unsubscribeTo | ( | PortInfo * | port | ) |
Unsubscribe a destination port.
| port | A PortInfo object pointer |
Definition at line 752 of file alsaport.cpp.
References PortInfo::getAddr(), MidiClient::getHandle(), Subscription::setDest(), Subscription::setSender(), and MidiPort::unsubscribe().
| void unsubscribeTo | ( | QString const & | name | ) |
Unsubscribe a destination port.
| name | A string representing a client:port pair |
Definition at line 733 of file alsaport.cpp.
References PortInfo::getAddr(), MidiClient::getHandle(), MidiClient::parseAddress(), Subscription::setDest(), Subscription::setSender(), and MidiPort::unsubscribe().
Referenced by MidiPort::updateConnectionsTo().
| void updateConnectionsFrom | ( | const PortInfoList & | ports | ) |
Update the read susbcriptions.
| ports | List of readable ports to be subscribed |
Definition at line 1256 of file alsaport.cpp.
References MidiPort::containsAddress(), PortInfo::getAddr(), MidiPort::getWriteSubscribers(), MidiPort::subscribeFrom(), and MidiPort::unsubscribeFrom().
| void updateConnectionsTo | ( | const PortInfoList & | ports | ) |
Update the write subscriptions.
| ports | List of writable ports to be subscribed |
Definition at line 1233 of file alsaport.cpp.
References MidiPort::containsAddress(), PortInfo::getAddr(), MidiPort::getReadSubscribers(), MidiPort::subscribeTo(), and MidiPort::unsubscribeTo().