drumstick 2.9.0
C++ MIDI libraries using Qt objects, idioms, and style.

Port information container. More...

#include <alsaport.h>

Public Member Functions

 PortInfo ()
 Default constructor.
 
 PortInfo (const PortInfo &other)
 Copy constructor. More...
 
 PortInfo (snd_seq_port_info_t *other)
 Constructor. More...
 
 PortInfo (MidiClient *seq, const int client, const int port)
 Constructor. More...
 
 PortInfo (MidiClient *seq, const int port)
 Constructor. More...
 
virtual ~PortInfo ()
 Destructor.
 
PortInfoclone ()
 Copy the current object. More...
 
PortInfooperator= (const PortInfo &other)
 Assignment operator. More...
 
int getSizeOfInfo () const
 Gets the size of the ALSA info object. More...
 
int getClient ()
 Gets the client number. More...
 
int getPort ()
 Gets the port number. More...
 
QString getClientName () const
 Gets the client name. More...
 
const snd_seq_addr_t * getAddr ()
 Gets the address record for this port. More...
 
QString getName ()
 Gets the port name. More...
 
unsigned int getCapability ()
 Gets the capabilities bitmap. More...
 
unsigned int getType ()
 Gets the port type. More...
 
int getMidiChannels ()
 Gets the MIDI channels. More...
 
int getMidiVoices ()
 Gets the MIDI voices. More...
 
int getSynthVoices ()
 Gets the synth voices. More...
 
int getReadUse ()
 Get the number of read subscriptions. More...
 
int getWriteUse ()
 Gets the number of write subscriptions. More...
 
int getPortSpecified ()
 Gets the port-specified mode. More...
 
void setClient (int client)
 Sets the client number. More...
 
void setPort (int port)
 Set the port number. More...
 
void setAddr (const snd_seq_addr_t *addr)
 Sets the address record. More...
 
void setName (QString const &name)
 Sets the port name. More...
 
void setCapability (unsigned int capability)
 Sets the capability bitmap. More...
 
void setType (unsigned int type)
 Sets the port type. More...
 
void setMidiChannels (int channels)
 Set the MIDI channels. More...
 
void setMidiVoices (int voices)
 Sets the MIDI voices. More...
 
void setSynthVoices (int voices)
 Sets the synth voices. More...
 
void setPortSpecified (int val)
 Sets the port-specified mode. More...
 
SubscribersList getReadSubscribers () const
 Gets the list of read subscribers. More...
 
SubscribersList getWriteSubscribers () const
 Gets the list of write subscribers. More...
 
bool getTimestamping ()
 Gets the timestamping mode. More...
 
bool getTimestampReal ()
 Gets the timestamping real mode. More...
 
int getTimestampQueue ()
 Gets the timestamping queue number. More...
 
void setTimestamping (bool value)
 Sets the timestamping mode. More...
 
void setTimestampReal (bool value)
 Sets the timestamping real mode. More...
 
void setTimestampQueue (int queueId)
 Sets the timestamp queue number. More...
 

Protected Member Functions

void readSubscribers (MidiClient *seq)
 Obtains the port subscribers lists. More...
 
void freeSubscribers ()
 Releases the subscribers lists.
 
void setClientName (QString name)
 Sets the client name. More...
 

Detailed Description

Port information container.

Examples
drumgrid.cpp, and sysinfo.cpp.

Definition at line 51 of file alsaport.h.

Constructor & Destructor Documentation

◆ PortInfo() [1/4]

PortInfo ( const PortInfo other)

Copy constructor.

Parameters
otherAnother PortInfo object reference

Definition at line 66 of file alsaport.cpp.

◆ PortInfo() [2/4]

PortInfo ( snd_seq_port_info_t *  other)
explicit

Constructor.

Parameters
otherAn ALSA port info object pointer

Definition at line 79 of file alsaport.cpp.

◆ PortInfo() [3/4]

PortInfo ( MidiClient seq,
const int  client,
const int  port 
)

Constructor.

Parameters
seqA MidiClient instance
clientAn existing client number
portAn existing port number

Definition at line 91 of file alsaport.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING, and MidiClient::getHandle().

◆ PortInfo() [4/4]

PortInfo ( MidiClient seq,
const int  port 
)

Constructor.

Parameters
seqA MidiClient instance
portAn existing port number

Definition at line 102 of file alsaport.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING, and MidiClient::getHandle().

Member Function Documentation

◆ clone()

PortInfo * clone ( )

Copy the current object.

Returns
A pointer to the new object

Definition at line 121 of file alsaport.cpp.

References PortInfo::PortInfo().

◆ getAddr()

const snd_seq_addr_t * getAddr ( )

Gets the address record for this port.

Returns
A pointer to the address record
See also
setAddr()

Definition at line 180 of file alsaport.cpp.

Referenced by MidiPort::containsAddress(), MidiPort::subscribeFrom(), MidiPort::subscribeTo(), MidiPort::unsubscribeFrom(), MidiPort::unsubscribeTo(), MidiPort::updateConnectionsFrom(), and MidiPort::updateConnectionsTo().

◆ getCapability()

unsigned int getCapability ( )

Gets the capabilities bitmap.

Returns
The capabilities bitmap
See also
setCapability()

Definition at line 202 of file alsaport.cpp.

Referenced by MidiClient::filterPorts(), MidiPort::getCapability(), MidiPort::getReadSubscribers(), and MidiPort::getWriteSubscribers().

◆ getClient()

int getClient ( )

Gets the client number.

Returns
The client number
See also
setClient()

Definition at line 148 of file alsaport.cpp.

Referenced by MidiPort::getReadSubscribers(), MidiPort::getWriteSubscribers(), MidiClient::portDetach(), and PortInfo::readSubscribers().

◆ getClientName()

QString getClientName ( ) const

Gets the client name.

Returns
the client name
See also
setClientName()
Examples
drumgrid.cpp.

Definition at line 169 of file alsaport.cpp.

◆ getMidiChannels()

int getMidiChannels ( )

Gets the MIDI channels.

Returns
The MIDI channels
See also
setMidiChannels()

Definition at line 224 of file alsaport.cpp.

Referenced by MidiPort::getMidiChannels().

◆ getMidiVoices()

int getMidiVoices ( )

Gets the MIDI voices.

Returns
The MIDI voices
See also
setMidiVoices()

Definition at line 235 of file alsaport.cpp.

Referenced by MidiPort::getMidiVoices().

◆ getName()

QString getName ( )

Gets the port name.

Returns
The port name
See also
setName()
Examples
sysinfo.cpp.

Definition at line 191 of file alsaport.cpp.

Referenced by MidiPort::getPortName().

◆ getPort()

int getPort ( )

Gets the port number.

Returns
The port number
See also
setPort()
Examples
drumgrid.cpp, and sysinfo.cpp.

Definition at line 159 of file alsaport.cpp.

Referenced by MidiPort::applyPortInfo(), MidiClient::detachAllPorts(), MidiPort::getPortId(), MidiClient::portDetach(), and PortInfo::readSubscribers().

◆ getPortSpecified()

int getPortSpecified ( )

Gets the port-specified mode.

Returns
The port-specified mode.
See also
setPortSpecified()

Definition at line 277 of file alsaport.cpp.

◆ getReadSubscribers()

SubscribersList getReadSubscribers ( ) const

Gets the list of read subscribers.

Returns
The list of read subscribers
Examples
sysinfo.cpp.

Definition at line 424 of file alsaport.cpp.

Referenced by MidiPort::getReadSubscribers().

◆ getReadUse()

int getReadUse ( )

Get the number of read subscriptions.

Returns
The number of read subscriptions.

Definition at line 256 of file alsaport.cpp.

◆ getSizeOfInfo()

int getSizeOfInfo ( ) const

Gets the size of the ALSA info object.

Returns
The size of the object

Definition at line 496 of file alsaport.cpp.

◆ getSynthVoices()

int getSynthVoices ( )

Gets the synth voices.

Returns
The synth voices
See also
setSynthVoices()

Definition at line 246 of file alsaport.cpp.

Referenced by MidiPort::getSynthVoices().

◆ getTimestamping()

bool getTimestamping ( )

Gets the timestamping mode.

Returns
The timestamping mode
See also
setTimestamping()

Definition at line 507 of file alsaport.cpp.

Referenced by MidiPort::getTimestamping().

◆ getTimestampQueue()

int getTimestampQueue ( )

Gets the timestamping queue number.

Returns
The timestamping queue number
See also
setTimestampQueue()

Definition at line 529 of file alsaport.cpp.

Referenced by MidiPort::getTimestampQueue().

◆ getTimestampReal()

bool getTimestampReal ( )

Gets the timestamping real mode.

Returns
The timestamping real mode
See also
setTimestampReal()

Definition at line 518 of file alsaport.cpp.

Referenced by MidiPort::getTimestampReal().

◆ getType()

unsigned int getType ( )

Gets the port type.

Returns
The port type
See also
setType()
Examples
sysinfo.cpp.

Definition at line 213 of file alsaport.cpp.

Referenced by MidiPort::getPortType().

◆ getWriteSubscribers()

SubscribersList getWriteSubscribers ( ) const

Gets the list of write subscribers.

Returns
The list of write subscribers
Examples
sysinfo.cpp.

Definition at line 434 of file alsaport.cpp.

Referenced by MidiPort::getWriteSubscribers().

◆ getWriteUse()

int getWriteUse ( )

Gets the number of write subscriptions.

Returns
The number of write subscriptions.

Definition at line 266 of file alsaport.cpp.

◆ operator=()

PortInfo & operator= ( const PortInfo other)

Assignment operator.

Parameters
otherAnother PortInfo object reference
Returns
This object

Definition at line 131 of file alsaport.cpp.

◆ readSubscribers()

void readSubscribers ( MidiClient seq)
protected

◆ setAddr()

void setAddr ( const snd_seq_addr_t *  addr)

Sets the address record.

Parameters
addrAn address record pointer
See also
getAddr()

Definition at line 310 of file alsaport.cpp.

◆ setCapability()

void setCapability ( unsigned int  capability)

Sets the capability bitmap.

Each port has the capability bitmaps to specify the access of the port from other clients. The capability bit flags are:

  • SND_SEQ_PORT_CAP_READ Readable from this port
  • SND_SEQ_PORT_CAP_WRITE Writable to this port
  • SND_SEQ_PORT_CAP_DUPLEX Read/write duplex access is supported
  • SND_SEQ_PORT_CAP_SUBS_READ Read subscription is allowed
  • SND_SEQ_PORT_CAP_SUBS_WRITE Write subscription is allowed
  • SND_SEQ_PORT_CAP_NO_EXPORT Subscription management from 3rd clients is disallowed
Parameters
capabilityThe capability bitmap.
See also
getCapability()

Definition at line 343 of file alsaport.cpp.

Referenced by MidiPort::setCapability().

◆ setClient()

void setClient ( int  client)

Sets the client number.

Parameters
clientThe client number
See also
getClient()

Definition at line 288 of file alsaport.cpp.

Referenced by ClientInfo::readPorts().

◆ setClientName()

void setClientName ( QString  name)
protected

Sets the client name.

See also
getClientName()
Parameters
nameClient name

Definition at line 486 of file alsaport.cpp.

Referenced by MidiPort::getReadSubscribers(), MidiPort::getWriteSubscribers(), and ClientInfo::readPorts().

◆ setMidiChannels()

void setMidiChannels ( int  channels)

Set the MIDI channels.

Parameters
channelsThe MIDI channels
See also
getMidiChannels()

Definition at line 381 of file alsaport.cpp.

Referenced by MidiPort::setMidiChannels().

◆ setMidiVoices()

void setMidiVoices ( int  voices)

Sets the MIDI voices.

Parameters
voicesThe MIDI voices
See also
getMidiVoices()

Definition at line 392 of file alsaport.cpp.

Referenced by MidiPort::setMidiVoices().

◆ setName()

void setName ( QString const &  name)

Sets the port name.

Parameters
nameThe port name
See also
getName()

Definition at line 321 of file alsaport.cpp.

Referenced by MidiPort::setPortName().

◆ setPort()

void setPort ( int  port)

Set the port number.

Parameters
portThe port number
See also
getPort()

Definition at line 299 of file alsaport.cpp.

Referenced by ClientInfo::readPorts().

◆ setPortSpecified()

void setPortSpecified ( int  val)

Sets the port-specified mode.

Parameters
valThe port-specified mode.
See also
getPortSpecified()

Definition at line 414 of file alsaport.cpp.

◆ setSynthVoices()

void setSynthVoices ( int  voices)

Sets the synth voices.

Parameters
voicesThe synth voices
See also
getSynthVoices()

Definition at line 403 of file alsaport.cpp.

Referenced by MidiPort::setSynthVoices().

◆ setTimestamping()

void setTimestamping ( bool  value)

Sets the timestamping mode.

Parameters
valueThe timestamping mode
See also
getTimestamping()

Definition at line 540 of file alsaport.cpp.

Referenced by MidiPort::setTimestamping().

◆ setTimestampQueue()

void setTimestampQueue ( int  queueId)

Sets the timestamp queue number.

Parameters
queueIdThe timestamp queue number
See also
getTimestampQueue()

Definition at line 562 of file alsaport.cpp.

Referenced by MidiPort::setTimestampQueue().

◆ setTimestampReal()

void setTimestampReal ( bool  value)

Sets the timestamping real mode.

Parameters
valueThe timestamping real mode
See also
getTimestampReal()

Definition at line 551 of file alsaport.cpp.

Referenced by MidiPort::setTimestampReal().

◆ setType()

void setType ( unsigned int  type)

Sets the port type.

The port type is defined combining some of the type bit flags:

  • SND_SEQ_PORT_TYPE_SPECIFIC Hardware specific port
  • SND_SEQ_PORT_TYPE_MIDI_GENERIC Generic MIDI device
  • SND_SEQ_PORT_TYPE_MIDI_GM General MIDI compatible device
  • SND_SEQ_PORT_TYPE_MIDI_GM2 General MIDI 2 compatible device
  • SND_SEQ_PORT_TYPE_MIDI_GS GS compatible device
  • SND_SEQ_PORT_TYPE_MIDI_XG XG compatible device
  • SND_SEQ_PORT_TYPE_MIDI_MT32 MT-32 compatible device
  • SND_SEQ_PORT_TYPE_HARDWARE Implemented in hardware
  • SND_SEQ_PORT_TYPE_SOFTWARE Implemented in software
  • SND_SEQ_PORT_TYPE_SYNTHESIZER Generates sound
  • SND_SEQ_PORT_TYPE_PORT Connects to other device(s)
  • SND_SEQ_PORT_TYPE_APPLICATION Application (sequencer/editor)
Parameters
typeThe port type bitmap
See also
getType()

Definition at line 370 of file alsaport.cpp.

Referenced by MidiPort::setPortType().


The documentation for this class was generated from the following files: