drumstick 1.1.3
alsaport.cpp
Go to the documentation of this file.
1/*
2 MIDI Sequencer C++ library
3 Copyright (C) 2006-2019, Pedro Lopez-Cabanillas <plcl@users.sf.net>
4
5 This library is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#include <drumstick/alsaqueue.h>
21
27namespace drumstick {
28
56{
57 snd_seq_port_info_malloc(&m_Info);
58}
59
65{
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;
71}
72
77PortInfo::PortInfo(snd_seq_port_info_t* other)
78{
79 snd_seq_port_info_malloc(&m_Info);
80 snd_seq_port_info_copy(m_Info, other);
81}
82
89PortInfo::PortInfo(MidiClient* seq, const int client, const int port)
90{
91 snd_seq_port_info_malloc(&m_Info);
92 CHECK_WARNING(snd_seq_get_any_port_info(seq->getHandle(), client, port, m_Info));
93}
94
100PortInfo::PortInfo(MidiClient* seq, const int port)
101{
102 snd_seq_port_info_malloc(&m_Info);
103 CHECK_WARNING(snd_seq_get_port_info(seq->getHandle(), port, m_Info));
104}
105
110{
111 snd_seq_port_info_free(m_Info);
113}
114
120{
121 return new PortInfo(m_Info);
122}
123
130{
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;
135 return *this;
136}
137
143int
145{
146 return snd_seq_port_info_get_client(m_Info);
147}
148
154int
156{
157 return snd_seq_port_info_get_port(m_Info);
158}
159
165const snd_seq_addr_t*
167{
168 return snd_seq_port_info_get_addr(m_Info);
169}
170
176QString
178{
179 return QString(snd_seq_port_info_get_name(m_Info));
180}
181
187unsigned int
189{
190 return snd_seq_port_info_get_capability(m_Info);
191}
192
198unsigned int
200{
201 return snd_seq_port_info_get_type(m_Info);
202}
203
209int
211{
212 return snd_seq_port_info_get_midi_channels(m_Info);
213}
214
220int
222{
223 return snd_seq_port_info_get_midi_voices(m_Info);
224}
225
231int
233{
234 return snd_seq_port_info_get_synth_voices(m_Info);
235}
236
241int
243{
244 return snd_seq_port_info_get_read_use(m_Info);
245}
246
251int
253{
254 return snd_seq_port_info_get_write_use(m_Info);
255}
256
262int
264{
265 return snd_seq_port_info_get_port_specified(m_Info);
266}
267
273void
275{
276 snd_seq_port_info_set_client(m_Info, client);
277}
278
284void
286{
287 snd_seq_port_info_set_port(m_Info, port);
288}
289
295void
296PortInfo::setAddr(const snd_seq_addr_t* addr)
297{
298 snd_seq_port_info_set_addr(m_Info, addr);
299}
300
306void
307PortInfo::setName(QString const& name)
308{
309 snd_seq_port_info_set_name(m_Info, name.toLocal8Bit().data());
310}
311
328void
329PortInfo::setCapability(unsigned int capability)
330{
331 snd_seq_port_info_set_capability(m_Info, capability);
332}
333
355void
356PortInfo::setType(unsigned int type)
357{
358 snd_seq_port_info_set_type(m_Info, type);
359}
360
366void
368{
369 snd_seq_port_info_set_midi_channels(m_Info, channels);
370}
371
377void
379{
380 snd_seq_port_info_set_midi_voices(m_Info, voices);
381}
382
388void
390{
391 snd_seq_port_info_set_synth_voices(m_Info, voices);
392}
393
399void
401{
402 snd_seq_port_info_set_port_specified(m_Info, val);
403}
404
411{
412 return m_ReadSubscribers; // copy
413}
414
421{
422 return m_WriteSubscribers; // copy
423}
424
429void
431{
432 Subscriber subs;
433 snd_seq_addr_t tmp;
435 tmp.client = getClient();
436 tmp.port = getPort();
437 // Read subs
438 subs.setType(SND_SEQ_QUERY_SUBS_READ);
439 subs.setIndex(0);
440 subs.setRoot(&tmp);
441 while (snd_seq_query_port_subscribers(seq->getHandle(), subs.m_Info) >= 0)
442 {
443 m_ReadSubscribers.append(subs);
444 subs.setIndex(subs.getIndex() + 1);
445 }
446 // Write subs
447 subs.setType(SND_SEQ_QUERY_SUBS_WRITE);
448 subs.setIndex(0);
449 subs.setRoot(&tmp);
450 while (snd_seq_query_port_subscribers(seq->getHandle(), subs.m_Info) >= 0)
451 {
452 m_WriteSubscribers.append(subs);
453 subs.setIndex(subs.getIndex() + 1);
454 }
455}
456
460void
462{
463 m_ReadSubscribers.clear();
464 m_WriteSubscribers.clear();
465}
466
471int
473{
474 return snd_seq_port_info_sizeof();
475}
476
482bool
484{
485 return (snd_seq_port_info_get_timestamping(m_Info) == 1);
486}
487
493bool
495{
496 return (snd_seq_port_info_get_timestamp_real(m_Info) == 1);
497}
498
504int
506{
507 return snd_seq_port_info_get_timestamp_queue(m_Info);
508}
509
515void
517{
518 snd_seq_port_info_set_timestamping(m_Info, value?1:0);
519}
520
526void
528{
529 snd_seq_port_info_set_timestamp_real(m_Info, value?1:0);
530}
531
537void
539{
540 snd_seq_port_info_set_timestamp_queue(m_Info, queueId);
541}
542
543
549 QObject( parent ),
550 m_MidiClient( NULL ),
551 m_Attached( false )
552{}
553
565
571{
572 return &m_Info;
573}
574
581{
582 return m_Subscriptions;
583}
584
588void
590{
591 m_Subscriptions.clear();
592}
593
598void
600{
601 if (m_MidiClient != seq)
602 {
603 m_MidiClient = seq;
604 emit midiClientChanged( this, m_MidiClient );
606 }
607}
608
613void
615{
616 subs->subscribe(m_MidiClient);
617 m_Subscriptions.append(*subs);
618 emit subscribed(this, subs);
619}
620
625void
627{
628 Subscription subs2;
629 if (m_MidiClient == NULL)
630 {
631 return;
632 }
633 subs->unsubscribe(m_MidiClient);
634 SubscriptionsList::iterator it;
635 for(it = m_Subscriptions.begin(); it != m_Subscriptions.end(); ++it)
636 {
637 subs2 = (*it);
638 if ((subs2.getSender()->client == subs->getSender()->client) &&
639 (subs2.getSender()->port == subs->getSender()->port) &&
640 (subs2.getDest()->client == subs->getDest()->client) &&
641 (subs2.getDest()->port == subs->getDest()->port))
642 {
643 m_Subscriptions.erase(it);
644 break;
645 }
646 }
647}
648
653void
655{
656 Subscription subs;
657 subs.setSender(m_Info.getAddr());
658 subs.setDest(info->getAddr());
659 subscribe(&subs);
660}
661
667void
668MidiPort::subscribeTo( int client, int port )
669{
670 Subscription subs;
671 snd_seq_addr addr;
672 addr.client = client;
673 addr.port = port;
674 subs.setSender(m_Info.getAddr());
675 subs.setDest(&addr);
676 subscribe(&subs);
677}
678
683void
684MidiPort::subscribeTo( QString const& name )
685{
686 Subscription subs;
687 snd_seq_addr addr;
688 if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL))
689 {
690 subs.setSender(m_Info.getAddr());
691 if (m_MidiClient->parseAddress(name, addr)) {
692 subs.setDest(&addr);
693 subscribe(&subs);
694 }
695 }
696}
697
702void
703MidiPort::unsubscribeTo( QString const& name )
704{
705 Subscription subs;
706 snd_seq_addr addr;
707 if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL))
708 {
709 subs.setSender(m_Info.getAddr());
710 if (m_MidiClient->parseAddress(name, addr)) {
711 subs.setDest(&addr);
712 unsubscribe(&subs);
713 }
714 }
715}
716
721void
723{
724 Subscription subs;
725 if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL))
726 {
727 subs.setSender(m_Info.getAddr());
728 subs.setDest(port->getAddr());
729 unsubscribe(&subs);
730 }
731}
732
737void
738MidiPort::unsubscribeTo( const snd_seq_addr_t* addr )
739{
740 Subscription subs;
741 if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL))
742 {
743 subs.setSender(m_Info.getAddr());
744 subs.setDest(addr);
745 unsubscribe(&subs);
746 }
747}
748
753void
755{
756 Subscription subs;
757 subs.setSender( port->getAddr() );
758 subs.setDest( m_Info.getAddr() );
759 subscribe(&subs);
760}
761
767void
768MidiPort::subscribeFrom( int client, int port )
769{
770 Subscription subs;
771 snd_seq_addr addr;
772 addr.client = client;
773 addr.port = port;
774 subs.setSender(&addr);
775 subs.setDest(m_Info.getAddr());
776 subscribe(&subs);
777}
778
783void
784MidiPort::subscribeFrom( QString const& name )
785{
786 Subscription subs;
787 snd_seq_addr addr;
788 if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL))
789 {
790 if (m_MidiClient->parseAddress(name, addr)) {
791 subs.setSender(&addr);
792 subs.setDest(m_Info.getAddr());
793 subscribe(&subs);
794 }
795 }
796}
797
802void
803MidiPort::unsubscribeFrom( QString const& name )
804{
805 Subscription subs;
806 snd_seq_addr addr;
807 if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL))
808 {
809 if (m_MidiClient->parseAddress(name, addr)) {
810 subs.setSender(&addr);
811 subs.setDest(m_Info.getAddr());
812 unsubscribe(&subs);
813 }
814 }
815}
816
821void
823{
824 Subscription subs;
825 if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL))
826 {
827 subs.setSender(port->getAddr());
828 subs.setDest(m_Info.getAddr());
829 unsubscribe(&subs);
830 }
831}
832
837void
838MidiPort::unsubscribeFrom( const snd_seq_addr_t* addr )
839{
840 Subscription subs;
841 if ((m_MidiClient != NULL) && (m_MidiClient->getHandle() != NULL))
842 {
843 subs.setSender(addr);
844 subs.setDest(m_Info.getAddr());
845 unsubscribe(&subs);
846 }
847}
848
852void
854{
855 subscribeFrom(SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_ANNOUNCE);
856}
857
861void
863{
864 if (m_MidiClient == NULL) {
865 return;
866 }
867 SubscriptionsList::Iterator it;
868 for( it = m_Subscriptions.begin(); it != m_Subscriptions.end(); ++it) {
869 Subscription s = (*it);
870 s.unsubscribe(m_MidiClient);
871 }
872 m_Subscriptions.clear();
873}
874
878void
880{
881 if (m_Attached && (m_MidiClient != NULL) && (m_MidiClient->isOpened()))
882 {
883 CHECK_WARNING(snd_seq_set_port_info( m_MidiClient->getHandle(),
884 m_Info.getPort(), m_Info.m_Info ));
885 }
886}
887
892QString
894{
895 return m_Info.getName();
896}
897
902void
903MidiPort::setPortName( QString const& newName )
904{
905 m_Info.setName(newName);
907}
908
913int
915{
916 return m_Info.getPort();
917}
918
924unsigned int
926{
927 return m_Info.getCapability();
928}
929
935void
936MidiPort::setCapability(unsigned int newValue)
937{
938 m_Info.setCapability(newValue);
940}
941
947unsigned int
949{
950 return m_Info.getType();
951}
952
958void
959MidiPort::setPortType( unsigned int newValue)
960{
961 m_Info.setType( newValue );
963}
964
969int
971{
972 return m_Info.getMidiChannels();
973}
974
979void
981{
982 m_Info.setMidiChannels( newValue );
984}
985
990int
992{
993 return m_Info.getMidiVoices();
994}
995
1000void
1002{
1003 m_Info.setMidiVoices( newValue );
1004 applyPortInfo();
1005}
1006
1011int
1013{
1014 return m_Info.getSynthVoices();
1015}
1016
1021void
1023{
1024 m_Info.setSynthVoices( newValue );
1025 applyPortInfo();
1026}
1027
1032bool
1034{
1035 return m_Info.getTimestamping();
1036}
1037
1042bool
1044{
1045 return m_Info.getTimestampReal();
1046}
1047
1052int
1054{
1055 return m_Info.getTimestampQueue();
1056}
1057
1062void
1064{
1065 m_Info.setTimestamping(value);
1066 applyPortInfo();
1067}
1068
1073void
1075{
1076 m_Info.setTimestampReal(value);
1077 applyPortInfo();
1078}
1079
1084void
1086{
1087 m_Info.setTimestampQueue(queueId);
1088 applyPortInfo();
1089}
1090
1095void
1097{
1098 if (!m_Attached && (seq != NULL)) {
1099 m_MidiClient = seq;
1100 m_MidiClient->portAttach(this);
1101 m_Attached = true;
1102 emit attached(this);
1103 }
1104}
1105
1109void
1111{
1112 if (m_Attached && (m_MidiClient != NULL)) {
1113 m_MidiClient->portDetach(this);
1114 m_Attached = false;
1115 emit detached(this);
1116 }
1117}
1118
1122void
1124{
1125 m_Info.readSubscribers(m_MidiClient);
1126}
1127
1134{
1135 const SubscribersList subs(m_Info.getReadSubscribers());
1136 PortInfoList lst;
1137 SubscribersList::ConstIterator it;
1138 for(it = subs.constBegin(); it != subs.constEnd(); ++it) {
1139 Subscriber s = *it;
1140 int client = s.getAddr()->client;
1141 if ((client != SND_SEQ_CLIENT_SYSTEM) && (client != m_Info.getClient())) {
1142 int port = s.getAddr()->port;
1143 PortInfo p(m_MidiClient, client, port);
1144 if ((p.getCapability() & SND_SEQ_PORT_CAP_NO_EXPORT) == 0) {
1145 p.setClientName(m_MidiClient->getClientName(client));
1146 lst << p;
1147 }
1148 }
1149 }
1150 return lst;
1151}
1152
1159{
1160 const SubscribersList subs(m_Info.getWriteSubscribers());
1161 PortInfoList lst;
1162 SubscribersList::ConstIterator it;
1163 for(it = subs.constBegin(); it != subs.constEnd(); ++it) {
1164 Subscriber s = *it;
1165 int client = s.getAddr()->client;
1166 if ((client != SND_SEQ_CLIENT_SYSTEM) && (client != m_Info.getClient())) {
1167 int port = s.getAddr()->port;
1168 PortInfo p(m_MidiClient, client, port);
1169 if ((p.getCapability() & SND_SEQ_PORT_CAP_NO_EXPORT) == 0) {
1170 p.setClientName(m_MidiClient->getClientName(client));
1171 lst << p;
1172 }
1173 }
1174 }
1175 return lst;
1176}
1177
1184bool
1185MidiPort::containsAddress(const snd_seq_addr_t* addr, const PortInfoList& lst)
1186{
1187 PortInfoList::ConstIterator i;
1188 for( i = lst.begin(); i != lst.end(); ++i) {
1189 PortInfo p = *i;
1190 if ((p.getAddr()->client == addr->client) &&
1191 (p.getAddr()->port == addr->port)) {
1192 return true;
1193 }
1194 }
1195 return false;
1196}
1197
1202void
1204{
1206 PortInfoList::ConstIterator i;
1207 for (i = subs.constBegin(); i != subs.constEnd(); ++i) {
1208 PortInfo s = *i;
1209 if (!containsAddress(s.getAddr(), ports)) {
1211 }
1212 }
1213 for (i = ports.constBegin(); i != ports.constEnd(); ++i) {
1214 PortInfo p = *i;
1215 if (!containsAddress(p.getAddr(), subs)) {
1216 subscribeTo(&p);
1217 }
1218 }
1219}
1220
1225void
1227{
1229 PortInfoList::ConstIterator i;
1230 for (i = subs.constBegin(); i != subs.constEnd(); ++i) {
1231 PortInfo s = *i;
1232 if (!containsAddress(s.getAddr(), ports)) {
1234 }
1235 }
1236 for (i = ports.constBegin(); i != ports.constEnd(); ++i) {
1237 PortInfo p = *i;
1238 if (!containsAddress(p.getAddr(), subs)) {
1239 subscribeFrom(&p);
1240 }
1241 }
1242}
1243
1244} /* namespace drumstick; */
Classes managing ALSA Sequencer clients.
QList< PortInfo > PortInfoList
List of port information objects.
Definition alsaport.h:111
Classes managing ALSA Sequencer queues.
The QObject class is the base class of all Qt objects.
Client management.
Definition alsaclient.h:198
bool parseAddress(const QString &straddr, snd_seq_addr &result)
Parse a text address representation, returning an ALSA address record.
snd_seq_t * getHandle()
Returns the sequencer handler managed by ALSA.
void portDetach(MidiPort *port)
Detach a MidiPort instance from this client.
QString getClientName()
Gets the client's public name.
void portAttach(MidiPort *port)
Attach a MidiPort instance to this client.
bool isOpened()
Returns true if the sequencer is opened.
QString getPortName()
Gets the port name.
Definition alsaport.cpp:893
void freeSubscriptions()
Releases the lists of subscriptions.
Definition alsaport.cpp:589
void detached(MidiPort *port)
Signal emitted when the port is detached from a MidiClient.
void subscribeTo(PortInfo *port)
Subscribe to another port destination.
Definition alsaport.cpp:654
void updateConnectionsTo(const PortInfoList &desired)
Update the write subscriptions.
virtual ~MidiPort()
Destructor.
Definition alsaport.cpp:559
void unsubscribeAll()
Unsubscribe all subscriptions.
Definition alsaport.cpp:862
void attached(MidiPort *port)
Signal emitted when the port is attached to a MidiClient.
void unsubscribeTo(QString const &name)
Unsubscribe a destination port.
Definition alsaport.cpp:703
void subscribe(Subscription *subs)
Subscribe a Subscription object.
Definition alsaport.cpp:614
void subscribeFrom(PortInfo *port)
Subscribe a source port.
Definition alsaport.cpp:754
PortInfoList getWriteSubscribers()
Gets the list of write subscribers.
bool getTimestamping()
Gets the timestamping mode.
void updateConnectionsFrom(const PortInfoList &desired)
Update the read susbcriptions.
void setPortName(QString const &newName)
Sets the port name.
Definition alsaport.cpp:903
unsigned int getPortType()
Gets the port type.
Definition alsaport.cpp:948
int getMidiVoices()
Gets the MIDI voices.
Definition alsaport.cpp:991
void unsubscribe(Subscription *subs)
Unsubscribe a Subscription object.
Definition alsaport.cpp:626
int getTimestampQueue()
Gets the timestamp queue number.
void attach(MidiClient *seq)
Attach the port to a MidiClient instance.
void setPortType(unsigned int newValue)
Sets the port type bitmap.
Definition alsaport.cpp:959
PortInfoList getReadSubscribers()
Gets the list of read subscribers.
int getMidiChannels()
Gets the MIDI channels.
Definition alsaport.cpp:970
void setCapability(unsigned int newValue)
Sets the port capabilities.
Definition alsaport.cpp:936
void midiClientChanged(MidiPort *port, MidiClient *seq)
Signal emitted when the MidiClient has changed.
bool getTimestampReal()
Gets the timestamp real mode.
static bool containsAddress(const snd_seq_addr_t *addr, const PortInfoList &lst)
Checks if the provided address is included in the port list.
void subscribeFromAnnounce()
Subscribe from the System:announce port.
Definition alsaport.cpp:853
void setTimestamping(bool value)
Sets the timestamping mode.
void setMidiClient(MidiClient *seq)
Sets the MidiClient.
Definition alsaport.cpp:599
int getSynthVoices()
Gets the synth voices.
int getPortId()
Gets the port number.
Definition alsaport.cpp:914
void setMidiVoices(int newValue)
Sets the MIDI voices.
void setMidiChannels(int newValue)
Sets the MIDI channels.
Definition alsaport.cpp:980
void updateSubscribers()
Update the subscribers list in the PortInfo member.
void detach()
Detach the port from any MidiClient instance previously attached.
void setSynthVoices(int newValue)
Sets the synth voices.
void unsubscribeFrom(QString const &name)
Unsubscribe a source port.
Definition alsaport.cpp:803
PortInfo * getPortInfo()
Gets the PortInfo object pointer.
Definition alsaport.cpp:570
void setTimestampReal(bool value)
Sets the timestamp real mode.
unsigned int getCapability()
Gets the port capabilities.
Definition alsaport.cpp:925
void setTimestampQueue(int queueId)
Sets the timestamp queue number.
SubscriptionsList getSubscriptions() const
Gets the list of susbcriptions.
Definition alsaport.cpp:580
void applyPortInfo()
Applies all the the delayed PortInfo changes to the MIDI port object.
Definition alsaport.cpp:879
MidiPort(QObject *parent=0)
Constructor.
Definition alsaport.cpp:548
void subscribed(MidiPort *port, Subscription *subs)
Signal emitted when an internal subscription is done.
Port information container.
Definition alsaport.h:40
void freeSubscribers()
Releases the subscribers lists.
Definition alsaport.cpp:461
int getSizeOfInfo() const
Gets the size of the ALSA info object.
Definition alsaport.cpp:472
void setCapability(unsigned int capability)
Sets the capability bitmap.
Definition alsaport.cpp:329
int getWriteUse()
Gets the number of write subscriptions.
Definition alsaport.cpp:252
int getPortSpecified()
Gets the port-specified mode.
Definition alsaport.cpp:263
int getReadUse()
Get the number of read subscriptions.
Definition alsaport.cpp:242
unsigned int getType()
Gets the port type.
Definition alsaport.cpp:199
void setType(unsigned int type)
Sets the port type.
Definition alsaport.cpp:356
SubscribersList getReadSubscribers() const
Gets the list of read subscribers.
Definition alsaport.cpp:410
void readSubscribers(MidiClient *seq)
Obtains the port subscribers lists.
Definition alsaport.cpp:430
bool getTimestamping()
Gets the timestamping mode.
Definition alsaport.cpp:483
void setMidiVoices(int voices)
Sets the MIDI voices.
Definition alsaport.cpp:378
int getClient()
Gets the client number.
Definition alsaport.cpp:144
const snd_seq_addr_t * getAddr()
Gets the address record for this port.
Definition alsaport.cpp:166
virtual ~PortInfo()
Destructor.
Definition alsaport.cpp:109
int getPort()
Gets the port number.
Definition alsaport.cpp:155
int getMidiVoices()
Gets the MIDI voices.
Definition alsaport.cpp:221
int getTimestampQueue()
Gets the timestamping queue number.
Definition alsaport.cpp:505
int getMidiChannels()
Gets the MIDI channels.
Definition alsaport.cpp:210
bool getTimestampReal()
Gets the timestamping real mode.
Definition alsaport.cpp:494
PortInfo & operator=(const PortInfo &other)
Assignment operator.
Definition alsaport.cpp:129
void setTimestamping(bool value)
Sets the timestamping mode.
Definition alsaport.cpp:516
PortInfo()
Default constructor.
Definition alsaport.cpp:55
void setClient(int client)
Sets the client number.
Definition alsaport.cpp:274
int getSynthVoices()
Gets the synth voices.
Definition alsaport.cpp:232
QString getName()
Gets the port name.
Definition alsaport.cpp:177
void setPortSpecified(int val)
Sets the port-specified mode.
Definition alsaport.cpp:400
void setMidiChannels(int channels)
Set the MIDI channels.
Definition alsaport.cpp:367
void setName(QString const &name)
Sets the port name.
Definition alsaport.cpp:307
PortInfo * clone()
Copy the current object.
Definition alsaport.cpp:119
SubscribersList getWriteSubscribers() const
Gets the list of write subscribers.
Definition alsaport.cpp:420
void setTimestampReal(bool value)
Sets the timestamping real mode.
Definition alsaport.cpp:527
unsigned int getCapability()
Gets the capabilities bitmap.
Definition alsaport.cpp:188
void setClientName(QString name)
Sets the client name.
Definition alsaport.h:98
void setTimestampQueue(int queueId)
Sets the timestamp queue number.
Definition alsaport.cpp:538
void setPort(int port)
Set the port number.
Definition alsaport.cpp:285
void setSynthVoices(int voices)
Sets the synth voices.
Definition alsaport.cpp:389
void setAddr(const snd_seq_addr_t *addr)
Sets the address record.
Definition alsaport.cpp:296
Subscriber container class.
void setType(snd_seq_query_subs_type_t type)
Sets the subscription type.
void setRoot(snd_seq_addr_t *addr)
Sets the subscriber's root address.
void setIndex(int index)
Sets the index of the subscriber.
int getIndex()
Gets the index of the subscriber container.
const snd_seq_addr_t * getAddr()
Gets the subscriber's address.
Subscription management.
const snd_seq_addr_t * getSender()
Gets the sender address of the subscription (MIDI OUT port)
void setSender(unsigned char client, unsigned char port)
Sets the Subscription's sender (MIDI OUT) port.
void unsubscribe(MidiClient *seq)
Breaks the subscription in the ALSA sequencer subsystem.
void setDest(unsigned char client, unsigned char port)
Sets the Subscription's destination (MIDI IN) port.
const snd_seq_addr_t * getDest()
Gets the destination address of the subscription (MIDI IN port)
void subscribe(MidiClient *seq)
Performs the subscription in the ALSA sequencer subsystem.
#define CHECK_WARNING(x)
This macro calls the check warning function.
QList< Subscription > SubscriptionsList
List of subscriptions.
QList< Subscriber > SubscribersList
List of subscribers.