drumstick  1.1.0
Subscription Class Reference

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. More...
 
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 82 of file subscription.h.

Constructor & Destructor Documentation

Subscription ( const Subscription other)

Copy constructor.

Parameters
otherExisting Subscription object reference

Definition at line 296 of file subscription.cpp.

Subscription ( snd_seq_port_subscribe_t *  other)

Constructor.

Parameters
otherPointer to an ALSA subscription object

Definition at line 306 of file subscription.cpp.

Constructor.

Parameters
seqPointer to a MIDI Client object

Definition at line 316 of file subscription.cpp.

References CHECK_WARNING, and MidiClient::getHandle().

~Subscription ( )
virtual

Destructor.

Returns

Definition at line 326 of file subscription.cpp.

Member Function Documentation

Subscription * clone ( )

Copy the current object.

Returns
Pointer to the new object

Definition at line 336 of file subscription.cpp.

References Subscription::Subscription().

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 368 of file subscription.cpp.

Referenced by MidiPort::unsubscribe().

bool getExclusive ( )

Gets the subscription's exclusive flag.

Returns
Exclusive flag

Definition at line 388 of file subscription.cpp.

int getQueue ( )

Gets the susbcription's queue number.

Returns
Queue number

Definition at line 378 of file subscription.cpp.

const snd_seq_addr_t * getSender ( )

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

Returns
Pointer to the sender ALSA address record

Definition at line 358 of file subscription.cpp.

Referenced by MidiPort::unsubscribe().

int getSizeOfInfo ( ) const

Gets the size of the ALSA subscription object.

Returns
Size of the ALSA object

Definition at line 538 of file subscription.cpp.

bool getTimeReal ( )

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

Returns
Time real flag

Definition at line 408 of file subscription.cpp.

bool getTimeUpdate ( )

Gets the susbcription's time-update flag.

Returns
Time-update flag

Definition at line 398 of file subscription.cpp.

Subscription & operator= ( const Subscription other)

Assignment operator.

Parameters
otherExisting subscription object reference
Returns
This object

Definition at line 347 of file subscription.cpp.

void setDest ( unsigned char  client,
unsigned char  port 
)

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

Parameters
clientClient number
portPort number

Definition at line 493 of file subscription.cpp.

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

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 428 of file subscription.cpp.

void setExclusive ( bool  val)

Sets the subscription's exclusive flag.

Parameters
valExclusive flag

Definition at line 448 of file subscription.cpp.

void setQueue ( int  q)

Sets the Subscription's Queue number.

Parameters
qQueue number

Definition at line 438 of file subscription.cpp.

void setSender ( unsigned char  client,
unsigned char  port 
)

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

Parameters
clientClient number
portPort number

Definition at line 479 of file subscription.cpp.

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

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 418 of file subscription.cpp.

void setTimeReal ( bool  val)

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

Parameters
valTime real flag

Definition at line 468 of file subscription.cpp.

void setTimeUpdate ( bool  val)

Sets the susbcription's time-update flag.

Parameters
valTime update flag

Definition at line 458 of file subscription.cpp.

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 508 of file subscription.cpp.

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

Referenced by MidiPort::subscribe().

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 524 of file subscription.cpp.

References 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: