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

Subscription management. More...

#include <subscription.h>

Public Member Functions

 Subscription ()
 Default constructor.
 
 Subscription (const Subscription &other)
 Copy constructor. More...
 
 Subscription (snd_seq_port_subscribe_t *other)
 Constructor. More...
 
 Subscription (MidiClient *seq)
 Constructor. More...
 
virtual ~Subscription ()
 Destructor.
 
Subscriptionclone ()
 Copy the current object. More...
 
int getSizeOfInfo () const
 Gets the size of the ALSA subscription object. More...
 
void setSender (unsigned char client, unsigned char port)
 Sets the Subscription's sender (MIDI OUT) port. More...
 
void setDest (unsigned char client, unsigned char port)
 Sets the Subscription's destination (MIDI IN) port. More...
 
void subscribe (MidiClient *seq)
 Performs the subscription in the ALSA sequencer subsystem. More...
 
void unsubscribe (MidiClient *seq)
 Breaks the subscription in the ALSA sequencer subsystem. More...
 
const snd_seq_addr_t * getSender ()
 Gets the sender address of the subscription (MIDI OUT port) More...
 
const snd_seq_addr_t * getDest ()
 Gets the destination address of the subscription (MIDI IN port) More...
 
int getQueue ()
 Gets the susbcription's queue number. More...
 
bool getExclusive ()
 Gets the subscription's exclusive flag. More...
 
bool getTimeUpdate ()
 Gets the susbcription's time-update flag. More...
 
bool getTimeReal ()
 Gets the susbcription's time-real (time-stamping) flag. More...
 
void setSender (const snd_seq_addr_t *addr)
 Sets the Subscription's sender (MIDI OUT) port. More...
 
void setDest (const snd_seq_addr_t *addr)
 Sets the Subscription's destination (MIDI IN) port. More...
 
void setQueue (int queue)
 Sets the Subscription's Queue number. More...
 
void setExclusive (bool val)
 Sets the subscription's exclusive flag. More...
 
void setTimeUpdate (bool val)
 Sets the susbcription's time-update flag. More...
 
void setTimeReal (bool val)
 Sets the subscription's time real (time-stamping) flag. More...
 
Subscriptionoperator= (const Subscription &other)
 Assignment operator. More...
 

Detailed Description

Subscription management.

This class represents a connection between two ports.

Examples
dumpmid.cpp.

Definition at line 96 of file subscription.h.

Constructor & Destructor Documentation

◆ Subscription() [1/3]

Subscription ( const Subscription other)

Copy constructor.

Parameters
otherExisting Subscription object reference

Definition at line 299 of file subscription.cpp.

◆ Subscription() [2/3]

Subscription ( snd_seq_port_subscribe_t *  other)
explicit

Constructor.

Parameters
otherPointer to an ALSA subscription object

Definition at line 309 of file subscription.cpp.

◆ Subscription() [3/3]

Subscription ( MidiClient seq)
explicit

Constructor.

Parameters
seqPointer to a MIDI Client object

Definition at line 319 of file subscription.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING, and MidiClient::getHandle().

Member Function Documentation

◆ clone()

Subscription * clone ( )

Copy the current object.

Returns
Pointer to the new object

Definition at line 338 of file subscription.cpp.

References Subscription::Subscription().

◆ getDest()

const snd_seq_addr_t * getDest ( )

Gets the destination address of the subscription (MIDI IN port)

Returns
Pointer to the destination ALSA address record

Definition at line 372 of file subscription.cpp.

Referenced by MidiPort::unsubscribe().

◆ getExclusive()

bool getExclusive ( )

Gets the subscription's exclusive flag.

Returns
Exclusive flag

Definition at line 392 of file subscription.cpp.

◆ getQueue()

int getQueue ( )

Gets the susbcription's queue number.

Returns
Queue number

Definition at line 382 of file subscription.cpp.

◆ getSender()

const snd_seq_addr_t * getSender ( )

Gets the sender address of the subscription (MIDI OUT port)

Returns
Pointer to the sender ALSA address record
Examples
dumpmid.cpp.

Definition at line 362 of file subscription.cpp.

Referenced by MidiPort::unsubscribe().

◆ getSizeOfInfo()

int getSizeOfInfo ( ) const

Gets the size of the ALSA subscription object.

Returns
Size of the ALSA object

Definition at line 542 of file subscription.cpp.

◆ getTimeReal()

bool getTimeReal ( )

Gets the susbcription's time-real (time-stamping) flag.

Returns
Time real flag

Definition at line 412 of file subscription.cpp.

◆ getTimeUpdate()

bool getTimeUpdate ( )

Gets the susbcription's time-update flag.

Returns
Time-update flag

Definition at line 402 of file subscription.cpp.

◆ operator=()

Subscription & operator= ( const Subscription other)

Assignment operator.

Parameters
otherExisting subscription object reference
Returns
This object

Definition at line 349 of file subscription.cpp.

◆ setDest() [1/2]

void setDest ( const snd_seq_addr_t *  addr)

Sets the Subscription's destination (MIDI IN) port.

Parameters
addrPointer to the destination ALSA address record

Definition at line 432 of file subscription.cpp.

◆ setDest() [2/2]

void setDest ( unsigned char  client,
unsigned char  port 
)

Sets the Subscription's destination (MIDI IN) port.

Parameters
clientClient number
portPort number

Definition at line 497 of file subscription.cpp.

References Subscription::setDest().

Referenced by Subscription::setDest(), MidiPort::subscribeFrom(), MidiPort::subscribeTo(), MidiPort::unsubscribeFrom(), and MidiPort::unsubscribeTo().

◆ setExclusive()

void setExclusive ( bool  val)

Sets the subscription's exclusive flag.

Parameters
valExclusive flag

Definition at line 452 of file subscription.cpp.

◆ setQueue()

void setQueue ( int  q)

Sets the Subscription's Queue number.

Parameters
qQueue number

Definition at line 442 of file subscription.cpp.

◆ setSender() [1/2]

void setSender ( const snd_seq_addr_t *  addr)

Sets the Subscription's sender (MIDI OUT) port.

Parameters
addrPointer to the sender ALSA address record

Definition at line 422 of file subscription.cpp.

◆ setSender() [2/2]

void setSender ( unsigned char  client,
unsigned char  port 
)

Sets the Subscription's sender (MIDI OUT) port.

Parameters
clientClient number
portPort number

Definition at line 483 of file subscription.cpp.

References Subscription::setSender().

Referenced by Subscription::setSender(), MidiPort::subscribeFrom(), MidiPort::subscribeTo(), MidiPort::unsubscribeFrom(), and MidiPort::unsubscribeTo().

◆ setTimeReal()

void setTimeReal ( bool  val)

Sets the subscription's time real (time-stamping) flag.

Parameters
valTime real flag

Definition at line 472 of file subscription.cpp.

◆ setTimeUpdate()

void setTimeUpdate ( bool  val)

Sets the susbcription's time-update flag.

Parameters
valTime update flag

Definition at line 462 of file subscription.cpp.

◆ subscribe()

void subscribe ( MidiClient seq)

Performs the subscription in the ALSA sequencer subsystem.

Neither the sender nor the destination ports need to belong to the same MidiClient instance performing the subscription.

Parameters
seqMidiClient instance pointer

Definition at line 512 of file subscription.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING, MidiClient::getHandle(), and MidiClient::isOpened().

Referenced by MidiPort::subscribe().

◆ unsubscribe()

void unsubscribe ( MidiClient seq)

Breaks the subscription in the ALSA sequencer subsystem.

Neither the sender nor the destination ports need to belong to the same MidiClient instance breaking the subscription.

Parameters
seqMidiClient instance pointer

Definition at line 528 of file subscription.cpp.

References DRUMSTICK_ALSA_CHECK_WARNING, MidiClient::getHandle(), and MidiClient::isOpened().

Referenced by MidiPort::unsubscribe(), and MidiPort::unsubscribeAll().


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