Go to the documentation of this file.
57 snd_seq_port_info_malloc(&m_Info);
66 snd_seq_port_info_malloc(&m_Info);
67 snd_seq_port_info_copy(m_Info, other.m_Info);
68 m_ReadSubscribers = other.m_ReadSubscribers;
69 m_WriteSubscribers = other.m_WriteSubscribers;
70 m_ClientName = other.m_ClientName;
79 snd_seq_port_info_malloc(&m_Info);
80 snd_seq_port_info_copy(m_Info, other);
91 snd_seq_port_info_malloc(&m_Info);
102 snd_seq_port_info_malloc(&m_Info);
111 snd_seq_port_info_free(m_Info);
131 snd_seq_port_info_copy(m_Info, other.m_Info);
132 m_ReadSubscribers = other.m_ReadSubscribers;
133 m_WriteSubscribers = other.m_WriteSubscribers;
134 m_ClientName = other.m_ClientName;
146 return snd_seq_port_info_get_client(m_Info);
157 return snd_seq_port_info_get_port(m_Info);
165 const snd_seq_addr_t*
168 return snd_seq_port_info_get_addr(m_Info);
179 return QString(snd_seq_port_info_get_name(m_Info));
190 return snd_seq_port_info_get_capability(m_Info);
201 return snd_seq_port_info_get_type(m_Info);
212 return snd_seq_port_info_get_midi_channels(m_Info);
223 return snd_seq_port_info_get_midi_voices(m_Info);
234 return snd_seq_port_info_get_synth_voices(m_Info);
244 return snd_seq_port_info_get_read_use(m_Info);
254 return snd_seq_port_info_get_write_use(m_Info);
265 return snd_seq_port_info_get_port_specified(m_Info);
276 snd_seq_port_info_set_client(m_Info, client);
287 snd_seq_port_info_set_port(m_Info, port);
298 snd_seq_port_info_set_addr(m_Info, addr);
309 snd_seq_port_info_set_name(m_Info, name.toLocal8Bit().data());
331 snd_seq_port_info_set_capability(m_Info, capability);
358 snd_seq_port_info_set_type(m_Info, type);
369 snd_seq_port_info_set_midi_channels(m_Info, channels);
380 snd_seq_port_info_set_midi_voices(m_Info, voices);
391 snd_seq_port_info_set_synth_voices(m_Info, voices);
402 snd_seq_port_info_set_port_specified(m_Info, val);
412 return m_ReadSubscribers;
422 return m_WriteSubscribers;
438 subs.
setType(SND_SEQ_QUERY_SUBS_READ);
441 while (snd_seq_query_port_subscribers(seq->
getHandle(), subs.m_Info) >= 0)
443 m_ReadSubscribers.append(subs);
447 subs.
setType(SND_SEQ_QUERY_SUBS_WRITE);
450 while (snd_seq_query_port_subscribers(seq->
getHandle(), subs.m_Info) >= 0)
452 m_WriteSubscribers.append(subs);
463 m_ReadSubscribers.clear();
464 m_WriteSubscribers.clear();
474 return snd_seq_port_info_sizeof();
485 return (snd_seq_port_info_get_timestamping(m_Info) == 1);
496 return (snd_seq_port_info_get_timestamp_real(m_Info) == 1);
507 return snd_seq_port_info_get_timestamp_queue(m_Info);
518 snd_seq_port_info_set_timestamping(m_Info, value?1:0);
529 snd_seq_port_info_set_timestamp_real(m_Info, value?1:0);
540 snd_seq_port_info_set_timestamp_queue(m_Info, queueId);
550 m_MidiClient( NULL ),
582 return m_Subscriptions;
591 m_Subscriptions.clear();
601 if (m_MidiClient != seq)
617 m_Subscriptions.append(*subs);
629 if (m_MidiClient == NULL)
634 SubscriptionsList::iterator it;
635 for(it = m_Subscriptions.begin(); it != m_Subscriptions.end(); ++it)
643 m_Subscriptions.erase(it);
672 addr.client = client;
688 if ((m_MidiClient != NULL) && (m_MidiClient->
getHandle() != NULL))
707 if ((m_MidiClient != NULL) && (m_MidiClient->
getHandle() != NULL))
725 if ((m_MidiClient != NULL) && (m_MidiClient->
getHandle() != NULL))
741 if ((m_MidiClient != NULL) && (m_MidiClient->
getHandle() != NULL))
772 addr.client = client;
788 if ((m_MidiClient != NULL) && (m_MidiClient->
getHandle() != NULL))
807 if ((m_MidiClient != NULL) && (m_MidiClient->
getHandle() != NULL))
825 if ((m_MidiClient != NULL) && (m_MidiClient->
getHandle() != NULL))
841 if ((m_MidiClient != NULL) && (m_MidiClient->
getHandle() != NULL))
855 subscribeFrom(SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_ANNOUNCE);
864 if (m_MidiClient == NULL) {
867 SubscriptionsList::Iterator it;
868 for( it = m_Subscriptions.begin(); it != m_Subscriptions.end(); ++it) {
872 m_Subscriptions.clear();
881 if (m_Attached && (m_MidiClient != NULL) && (m_MidiClient->
isOpened()))
884 m_Info.
getPort(), m_Info.m_Info ));
1098 if (!m_Attached && (seq != NULL)) {
1112 if (m_Attached && (m_MidiClient != NULL)) {
1137 SubscribersList::ConstIterator it;
1138 for(it = subs.constBegin(); it != subs.constEnd(); ++it) {
1140 int client = s.
getAddr()->client;
1141 if ((client != SND_SEQ_CLIENT_SYSTEM) && (client != m_Info.
getClient())) {
1143 PortInfo p(m_MidiClient, client, port);
1144 if ((p.
getCapability() & SND_SEQ_PORT_CAP_NO_EXPORT) == 0) {
1162 SubscribersList::ConstIterator it;
1163 for(it = subs.constBegin(); it != subs.constEnd(); ++it) {
1165 int client = s.
getAddr()->client;
1166 if ((client != SND_SEQ_CLIENT_SYSTEM) && (client != m_Info.
getClient())) {
1168 PortInfo p(m_MidiClient, client, port);
1169 if ((p.
getCapability() & SND_SEQ_PORT_CAP_NO_EXPORT) == 0) {
1187 PortInfoList::ConstIterator i;
1188 for( i = lst.begin(); i != lst.end(); ++i) {
1190 if ((p.
getAddr()->client == addr->client) &&
1191 (p.
getAddr()->port == addr->port)) {
1206 PortInfoList::ConstIterator i;
1207 for (i = subs.constBegin(); i != subs.constEnd(); ++i) {
1213 for (i = ports.constBegin(); i != ports.constEnd(); ++i) {
1229 PortInfoList::ConstIterator i;
1230 for (i = subs.constBegin(); i != subs.constEnd(); ++i) {
1236 for (i = ports.constBegin(); i != ports.constEnd(); ++i) {
void updateConnectionsFrom(const PortInfoList &desired)
Update the read susbcriptions.
void setTimestampQueue(int queueId)
Sets the timestamp queue number.
void subscribe(Subscription *subs)
Subscribe a Subscription object.
The QObject class is the base class of all Qt objects.
#define CHECK_WARNING(x)
This macro calls the check warning function.
int getSynthVoices()
Gets the synth voices.
void setMidiVoices(int newValue)
Sets the MIDI voices.
PortInfoList getReadSubscribers()
Gets the list of read subscribers.
QString getPortName()
Gets the port name.
void subscribeFrom(PortInfo *port)
Subscribe a source port.
void applyPortInfo()
Applies all the the delayed PortInfo changes to the MIDI port object.
void setPortName(QString const &newName)
Sets the port name.
void setMidiChannels(int newValue)
Sets the MIDI channels.
bool isOpened()
Returns true if the sequencer is opened.
unsigned int getPortType()
Gets the port type.
PortInfo * getPortInfo()
Gets the PortInfo object pointer.
int getIndex()
Gets the index of the subscriber container.
bool parseAddress(const QString &straddr, snd_seq_addr &result)
Parse a text address representation, returning an ALSA address record.
int getMidiVoices()
Gets the MIDI voices.
snd_seq_t * getHandle()
Returns the sequencer handler managed by ALSA.
void setType(unsigned int type)
Sets the port type.
int getMidiChannels()
Gets the MIDI channels.
bool getTimestampReal()
Gets the timestamp real mode.
void portAttach(MidiPort *port)
Attach a MidiPort instance to this client.
const snd_seq_addr_t * getAddr()
Gets the address record for this port.
int getMidiChannels()
Gets the MIDI channels.
void setTimestampReal(bool value)
Sets the timestamp real mode.
void setPortType(unsigned int newValue)
Sets the port type bitmap.
void setPort(int port)
Set the port number.
Subscriber container class.
int getSynthVoices()
Gets the synth voices.
void setSynthVoices(int newValue)
Sets the synth voices.
SubscriptionsList getSubscriptions() const
Gets the list of susbcriptions.
virtual ~PortInfo()
Destructor.
void readSubscribers(MidiClient *seq)
Obtains the port subscribers lists.
QString getName()
Gets the port name.
static bool containsAddress(const snd_seq_addr_t *addr, const PortInfoList &lst)
Checks if the provided address is included in the port list.
void subscribeTo(PortInfo *port)
Subscribe to another port destination.
void setMidiClient(MidiClient *seq)
Sets the MidiClient.
const snd_seq_addr_t * getSender()
Gets the sender address of the subscription (MIDI OUT port)
int getClient()
Gets the client number.
Classes managing ALSA Sequencer queues.
void setTimestampQueue(int queueId)
Sets the timestamp queue number.
void detached(MidiPort *port)
Signal emitted when the port is detached from a MidiClient.
void freeSubscriptions()
Releases the lists of subscriptions.
int getSizeOfInfo() const
Gets the size of the ALSA info object.
bool getTimestamping()
Gets the timestamping mode.
unsigned int getType()
Gets the port type.
const snd_seq_addr_t * getDest()
Gets the destination address of the subscription (MIDI IN port)
void setSynthVoices(int voices)
Sets the synth voices.
void unsubscribe(Subscription *subs)
Unsubscribe a Subscription object.
int getReadUse()
Get the number of read subscriptions.
void unsubscribeTo(QString const &name)
Unsubscribe a destination port.
PortInfo & operator=(const PortInfo &other)
Assignment operator.
void subscribed(MidiPort *port, Subscription *subs)
Signal emitted when an internal subscription is done.
SubscribersList getWriteSubscribers() const
Gets the list of write subscribers.
PortInfo * clone()
Copy the current object.
int getPortId()
Gets the port number.
QString getClientName()
Gets the client's public name.
QList< PortInfo > PortInfoList
List of port information objects.
int getMidiVoices()
Gets the MIDI voices.
void setSender(unsigned char client, unsigned char port)
Sets the Subscription's sender (MIDI OUT) port.
void setTimestamping(bool value)
Sets the timestamping mode.
void setAddr(const snd_seq_addr_t *addr)
Sets the address record.
QList< Subscription > SubscriptionsList
List of subscriptions.
void setIndex(int index)
Sets the index of the subscriber.
void unsubscribeFrom(QString const &name)
Unsubscribe a source port.
int getTimestampQueue()
Gets the timestamp queue number.
bool getTimestampReal()
Gets the timestamping real mode.
int getPortSpecified()
Gets the port-specified mode.
void setMidiChannels(int channels)
Set the MIDI channels.
void midiClientChanged(MidiPort *port, MidiClient *seq)
Signal emitted when the MidiClient has changed.
int getWriteUse()
Gets the number of write subscriptions.
void setTimestamping(bool value)
Sets the timestamping mode.
PortInfoList getWriteSubscribers()
Gets the list of write subscribers.
void setPortSpecified(int val)
Sets the port-specified mode.
void attach(MidiClient *seq)
Attach the port to a MidiClient instance.
void setDest(unsigned char client, unsigned char port)
Sets the Subscription's destination (MIDI IN) port.
Port information container.
int getPort()
Gets the port number.
unsigned int getCapability()
Gets the capabilities bitmap.
Classes managing ALSA Sequencer clients.
void attached(MidiPort *port)
Signal emitted when the port is attached to a MidiClient.
void updateConnectionsTo(const PortInfoList &desired)
Update the write subscriptions.
void subscribeFromAnnounce()
Subscribe from the System:announce port.
MidiPort(QObject *parent=0)
Constructor.
void unsubscribeAll()
Unsubscribe all subscriptions.
void setCapability(unsigned int capability)
Sets the capability bitmap.
void setClientName(QString name)
Sets the client name.
void detach()
Detach the port from any MidiClient instance previously attached.
QList< Subscriber > SubscribersList
List of subscribers.
int getTimestampQueue()
Gets the timestamping queue number.
SubscribersList getReadSubscribers() const
Gets the list of read subscribers.
void updateSubscribers()
Update the subscribers list in the PortInfo member.
void setRoot(snd_seq_addr_t *addr)
Sets the subscriber's root address.
void setType(snd_seq_query_subs_type_t type)
Sets the subscription type.
void setName(QString const &name)
Sets the port name.
void setMidiVoices(int voices)
Sets the MIDI voices.
void portDetach(MidiPort *port)
Detach a MidiPort instance from this client.
unsigned int getCapability()
Gets the port capabilities.
void subscribe(MidiClient *seq)
Performs the subscription in the ALSA sequencer subsystem.
const snd_seq_addr_t * getAddr()
Gets the subscriber's address.
void freeSubscribers()
Releases the subscribers lists.
PortInfo()
Default constructor.
bool getTimestamping()
Gets the timestamping mode.
void unsubscribe(MidiClient *seq)
Breaks the subscription in the ALSA sequencer subsystem.
void setCapability(unsigned int newValue)
Sets the port capabilities.
void setTimestampReal(bool value)
Sets the timestamping real mode.
virtual ~MidiPort()
Destructor.
void setClient(int client)
Sets the client number.