drumstick  1.1.0
QueueTempo Class Reference

Queue tempo container. More...

#include <alsaqueue.h>

Public Member Functions

 QueueTempo ()
 Default constructor.
 
 QueueTempo (const QueueTempo &other)
 Copy constructor. More...
 
 QueueTempo (snd_seq_queue_tempo_t *other)
 Constructor. More...
 
virtual ~QueueTempo ()
 Destructor.
 
QueueTempoclone ()
 Copy the current object returning the copied object. More...
 
QueueTempooperator= (const QueueTempo &other)
 Assignment operator. More...
 
int getInfoSize () const
 Gets the size of the ALSA queue tempo object. More...
 
int getId ()
 Gets the queue's numeric identifier. More...
 
int getPPQ ()
 Gets the PPQ (parts per quarter note) resolution of the queue. More...
 
unsigned int getSkewValue ()
 Gets the tempo skew numerator. More...
 
unsigned int getSkewBase ()
 Gets the tempo skew base. More...
 
unsigned int getTempo ()
 Gets the queue's tempo in microseconds per beat. More...
 
void setPPQ (int value)
 Sets the queue resolution in parts per quarter note. More...
 
void setSkewValue (unsigned int value)
 Sets the tempo skew numerator. More...
 
void setTempo (unsigned int value)
 Sets the queue tempo in microseconds per beat. More...
 
float getNominalBPM ()
 Gets the queue's nominal BPM tempo (in beats per minute) More...
 
float getRealBPM ()
 Gets the queue's real BPM tempo in beats per minute. More...
 
void setTempoFactor (float value)
 Sets the queue's tempo skew factor. More...
 
void setNominalBPM (float value)
 Sets the queue's nominal tempo in BPM (beats per minute). More...
 

Protected Member Functions

void setSkewBase (unsigned int value)
 Sets the tempo skew base. More...
 

Detailed Description

Queue tempo container.

This class is used to hold some tempo properties of an ALSA queue object. The queue's resolution defines the meaning of the musical time, in ticks. It is expressed in PPQ (parts per quarter), or ticks in a quarter note (crotchet). The nominal tempo is usually expressed in BPM (beats per minute), or Maelzel metronome units. It can be also given in microseconds per beat. The tempo skew factor is given as two integer numbers: skew value and skew base, being the factor the quotient of both quantities = value / base. Currently (ALSA <= 1.0.20) you can only use the base constant 0x10000 (decimal 65536).

Examples:
sysinfo.cpp.

Definition at line 117 of file alsaqueue.h.

Constructor & Destructor Documentation

QueueTempo ( const QueueTempo other)

Copy constructor.

Parameters
otherAn existing QueueTempo object reference

Definition at line 355 of file alsaqueue.cpp.

QueueTempo ( snd_seq_queue_tempo_t *  other)

Constructor.

Parameters
otherAn ALSA queue tempo object pointer

Definition at line 345 of file alsaqueue.cpp.

Member Function Documentation

QueueTempo * clone ( )

Copy the current object returning the copied object.

Returns
The pointer to the new object

Definition at line 373 of file alsaqueue.cpp.

References QueueTempo::QueueTempo().

int getId ( )

Gets the queue's numeric identifier.

Returns
The queue's numeric identifier

Definition at line 393 of file alsaqueue.cpp.

int getInfoSize ( ) const

Gets the size of the ALSA queue tempo object.

Returns
The size of the ALSA object

Definition at line 525 of file alsaqueue.cpp.

float getNominalBPM ( )

Gets the queue's nominal BPM tempo (in beats per minute)

Returns
The queue's nominal BPM tempo (in beats per minute)
Examples:
sysinfo.cpp.

Definition at line 483 of file alsaqueue.cpp.

References QueueTempo::getTempo().

Referenced by QueueTempo::getRealBPM().

int getPPQ ( )

Gets the PPQ (parts per quarter note) resolution of the queue.

Returns
The PPQ (parts per quarter note) resolution
Examples:
sysinfo.cpp.

Definition at line 402 of file alsaqueue.cpp.

float getRealBPM ( )

Gets the queue's real BPM tempo in beats per minute.

The result is equal to the nominal BPM tempo multiplied by the skew factor.

Returns
Examples:
sysinfo.cpp.

Definition at line 496 of file alsaqueue.cpp.

References QueueTempo::getNominalBPM(), QueueTempo::getSkewValue(), and SKEW_BASE.

unsigned int getSkewBase ( )

Gets the tempo skew base.

The real skew factor is the quotient of the skew value divided by the skew base.

Returns
The tempo skew base.
See Also
getSkewValue(), setSkewValue(), setTempoFactor()

Definition at line 424 of file alsaqueue.cpp.

unsigned int getSkewValue ( )

Gets the tempo skew numerator.

The real skew factor is the quotient of this value divided by the skew base.

Returns
The tempo skew numerator.
See Also
getSkewBase(), setSkewValue(), setTempoFactor()

Definition at line 413 of file alsaqueue.cpp.

Referenced by QueueTempo::getRealBPM().

unsigned int getTempo ( )

Gets the queue's tempo in microseconds per beat.

Returns
The queue's tempo in microseconds per beat.

Definition at line 433 of file alsaqueue.cpp.

Referenced by QueueTempo::getNominalBPM().

QueueTempo & operator= ( const QueueTempo other)

Assignment operator.

Parameters
otherAn existing QueueTempo object reference
Returns
This object

Definition at line 383 of file alsaqueue.cpp.

void setNominalBPM ( float  value)

Sets the queue's nominal tempo in BPM (beats per minute).

Parameters
valueThe nominal tempo in BPM (beats per minute).

Definition at line 516 of file alsaqueue.cpp.

References QueueTempo::setTempo().

void setPPQ ( int  value)

Sets the queue resolution in parts per quarter note.

Parameters
valueThe queue resolution in PPQ.

Definition at line 442 of file alsaqueue.cpp.

void setSkewBase ( unsigned int  value)
protected

Sets the tempo skew base.

The real skew factor is the quotient of the skew value divided by the skew base.

Bug:
Protected because ALSA only accepts as argument a constant SKEW_BASE
Parameters
valueThe tempo skew base.
See Also
getSkewBase(), getSkewValue(), setTempoFactor()

Definition at line 465 of file alsaqueue.cpp.

Referenced by QueueTempo::setTempoFactor().

void setSkewValue ( unsigned int  value)

Sets the tempo skew numerator.

The real skew factor is the quotient of this value divided by the skew base.

Parameters
valueThe tempo skew numerator.
See Also
getSkewBase(), getSkewValue(), setTempoFactor()

Definition at line 453 of file alsaqueue.cpp.

Referenced by QueueTempo::setTempoFactor().

void setTempo ( unsigned int  value)

Sets the queue tempo in microseconds per beat.

Parameters
valueThe tempo in microseconds per beat

Definition at line 474 of file alsaqueue.cpp.

Referenced by QueueTempo::setNominalBPM().

void setTempoFactor ( float  value)

Sets the queue's tempo skew factor.

Parameters
valueThe tempo skew factor.

Definition at line 506 of file alsaqueue.cpp.

References QueueTempo::setSkewBase(), QueueTempo::setSkewValue(), and SKEW_BASE.


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