19#ifndef DRUMSTICK_ALSAPORT_H
20#define DRUMSTICK_ALSAPORT_H
32#if defined(DRUMSTICK_STATIC)
33#define DRUMSTICK_ALSA_EXPORT
35#if defined(drumstick_alsa_EXPORTS)
36#define DRUMSTICK_ALSA_EXPORT Q_DECL_EXPORT
38#define DRUMSTICK_ALSA_EXPORT Q_DECL_IMPORT
53 friend class MidiPort;
54 friend class ClientInfo;
55 friend class MidiClient;
60 explicit PortInfo(snd_seq_port_info_t* other);
61 PortInfo(MidiClient* seq,
const int client,
const int port);
62 PortInfo(MidiClient* seq,
const int port);
71 const snd_seq_addr_t*
getAddr();
83 void setAddr(
const snd_seq_addr_t* addr);
84 void setName( QString
const& name );
86 void setType(
unsigned int type);
107 snd_seq_port_info_t* m_Info;
108 QString m_ClientName;
127 friend class MidiClient;
133 void attach( MidiClient* seq );
212 MidiClient* m_MidiClient;
The QObject class is the base class of all Qt objects.
QString getPortName()
Gets the port name.
void freeSubscriptions()
Releases the lists of subscriptions.
void detached(drumstick::ALSA::MidiPort *port)
Signal emitted when the port is detached from a MidiClient.
MidiPort(QObject *parent=nullptr)
Constructor.
void subscribeTo(PortInfo *port)
Subscribe to another port destination.
void updateConnectionsTo(const PortInfoList &desired)
Update the write subscriptions.
void unsubscribeAll()
Unsubscribe all subscriptions.
void attached(drumstick::ALSA::MidiPort *port)
Signal emitted when the port is attached to a MidiClient.
void unsubscribeTo(QString const &name)
Unsubscribe a destination port.
void subscribe(Subscription *subs)
Subscribe a Subscription object.
void subscribeFrom(PortInfo *port)
Subscribe a source port.
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.
unsigned int getPortType()
Gets the port type.
int getMidiVoices()
Gets the MIDI voices.
void unsubscribe(Subscription *subs)
Unsubscribe a Subscription object.
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.
PortInfoList getReadSubscribers()
Gets the list of read subscribers.
int getMidiChannels()
Gets the MIDI channels.
void setCapability(unsigned int newValue)
Sets the port capabilities.
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.
void setTimestamping(bool value)
Sets the timestamping mode.
void setMidiClient(MidiClient *seq)
Sets the MidiClient.
int getSynthVoices()
Gets the synth voices.
int getPortId()
Gets the port number.
void setMidiVoices(int newValue)
Sets the MIDI voices.
void setMidiChannels(int newValue)
Sets the MIDI channels.
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 subscribed(drumstick::ALSA::MidiPort *port, drumstick::ALSA::Subscription *subs)
Signal emitted when an internal subscription is done.
void unsubscribeFrom(QString const &name)
Unsubscribe a source port.
PortInfo * getPortInfo()
Gets the PortInfo object pointer.
void midiClientChanged(drumstick::ALSA::MidiPort *port, drumstick::ALSA::MidiClient *seq)
Signal emitted when the MidiClient has changed.
void setTimestampReal(bool value)
Sets the timestamp real mode.
unsigned int getCapability()
Gets the port capabilities.
void setTimestampQueue(int queueId)
Sets the timestamp queue number.
SubscriptionsList getSubscriptions() const
Gets the list of susbcriptions.
void applyPortInfo()
Applies all the the delayed PortInfo changes to the MIDI port object.
Port information container.
void freeSubscribers()
Releases the subscribers lists.
int getSizeOfInfo() const
Gets the size of the ALSA info object.
void setCapability(unsigned int capability)
Sets the capability bitmap.
int getWriteUse()
Gets the number of write subscriptions.
int getPortSpecified()
Gets the port-specified mode.
QString getClientName() const
Gets the client name.
int getReadUse()
Get the number of read subscriptions.
unsigned int getType()
Gets the port type.
void setType(unsigned int type)
Sets the port type.
SubscribersList getReadSubscribers() const
Gets the list of read subscribers.
void readSubscribers(MidiClient *seq)
Obtains the port subscribers lists.
bool getTimestamping()
Gets the timestamping mode.
void setMidiVoices(int voices)
Sets the MIDI voices.
int getClient()
Gets the client number.
const snd_seq_addr_t * getAddr()
Gets the address record for this port.
int getPort()
Gets the port number.
int getMidiVoices()
Gets the MIDI voices.
int getTimestampQueue()
Gets the timestamping queue number.
int getMidiChannels()
Gets the MIDI channels.
bool getTimestampReal()
Gets the timestamping real mode.
PortInfo & operator=(const PortInfo &other)
Assignment operator.
void setTimestamping(bool value)
Sets the timestamping mode.
PortInfo()
Default constructor.
void setClient(int client)
Sets the client number.
int getSynthVoices()
Gets the synth voices.
QString getName()
Gets the port name.
void setPortSpecified(int val)
Sets the port-specified mode.
void setMidiChannels(int channels)
Set the MIDI channels.
void setName(QString const &name)
Sets the port name.
PortInfo * clone()
Copy the current object.
SubscribersList getWriteSubscribers() const
Gets the list of write subscribers.
void setTimestampReal(bool value)
Sets the timestamping real mode.
unsigned int getCapability()
Gets the capabilities bitmap.
void setClientName(QString name)
Sets the client name.
void setTimestampQueue(int queueId)
Sets the timestamp queue number.
void setPort(int port)
Set the port number.
void setSynthVoices(int voices)
Sets the synth voices.
void setAddr(const snd_seq_addr_t *addr)
Sets the address record.
QList< MidiPort * > MidiPortList
List of Ports instances.
QList< PortInfo > PortInfoList
List of port information objects.
QList< Subscription > SubscriptionsList
List of subscriptions.
QList< Subscriber > SubscribersList
List of subscribers.
Drumstick ALSA library wrapper.
Classes managing ALSA sequencer subscriptions.