Subscription Class Reference

Subscription management. More...

#include <subscription.h>

List of all members.

Public Member Functions

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


Detailed Description

Subscription management.

This class represents a connection between two ports.

Examples:

dumpmid.cpp, and vpiano.cpp.

Definition at line 82 of file subscription.h.


Constructor & Destructor Documentation

Subscription (  ) 

Default constructor.

Definition at line 287 of file subscription.cpp.

Referenced by Subscription::clone().

Subscription ( const Subscription other  ) 

Copy constructor.

Parameters:
other Existing Subscription object reference

Definition at line 296 of file subscription.cpp.

Subscription ( snd_seq_port_subscribe_t *  other  ) 

Constructor.

Parameters:
other Pointer to an ALSA subscription object

Definition at line 306 of file subscription.cpp.

Subscription ( MidiClient seq  ) 

Constructor.

Parameters:
seq Pointer 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:
other Existing subscription object reference
Returns:
This object

Definition at line 347 of file subscription.cpp.

void setDest ( const snd_seq_addr_t *  addr  ) 

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

Parameters:
addr Pointer to the destination ALSA address record

Definition at line 428 of file subscription.cpp.

void setDest ( unsigned char  client,
unsigned char  port 
)

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

Parameters:
client Client number
port Port number

Definition at line 493 of file subscription.cpp.

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

void setExclusive ( bool  val  ) 

Sets the subscription's exclusive flag.

Parameters:
val Exclusive flag

Definition at line 448 of file subscription.cpp.

void setQueue ( int  q  ) 

Sets the Subscription's Queue number.

Parameters:
q Queue number

Definition at line 438 of file subscription.cpp.

void setSender ( const snd_seq_addr_t *  addr  ) 

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

Parameters:
addr Pointer to the sender ALSA address record

Definition at line 418 of file subscription.cpp.

void setSender ( unsigned char  client,
unsigned char  port 
)

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

Parameters:
client Client number
port Port number

Definition at line 479 of file subscription.cpp.

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

void setTimeReal ( bool  val  ) 

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

Parameters:
val Time real flag

Definition at line 468 of file subscription.cpp.

void setTimeUpdate ( bool  val  ) 

Sets the susbcription's time-update flag.

Parameters:
val Time 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:
seq MidiClient 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:
seq MidiClient 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:

Generated on Wed Sep 8 10:12:54 2010 for drumstick by  doxygen 1.5.9