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

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
drumgrid.cpp, metronome.cpp, and sysinfo.cpp.

Definition at line 129 of file alsaqueue.h.

Constructor & Destructor Documentation

◆ QueueTempo() [1/2]

QueueTempo ( const QueueTempo other)

Copy constructor.

Parameters
otherAn existing QueueTempo object reference

Definition at line 366 of file alsaqueue.cpp.

◆ QueueTempo() [2/2]

QueueTempo ( snd_seq_queue_tempo_t *  other)
explicit

Constructor.

Parameters
otherAn ALSA queue tempo object pointer

Definition at line 356 of file alsaqueue.cpp.

Member Function Documentation

◆ clone()

QueueTempo * clone ( )

Copy the current object returning the copied object.

Returns
The pointer to the new object

Definition at line 384 of file alsaqueue.cpp.

References QueueTempo::QueueTempo().

◆ getId()

int getId ( )

Gets the queue's numeric identifier.

Returns
The queue's numeric identifier

Definition at line 406 of file alsaqueue.cpp.

◆ getInfoSize()

int getInfoSize ( ) const

Gets the size of the ALSA queue tempo object.

Returns
The size of the ALSA object

Definition at line 538 of file alsaqueue.cpp.

◆ getNominalBPM()

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 496 of file alsaqueue.cpp.

References QueueTempo::getTempo().

Referenced by QueueTempo::getRealBPM().

◆ getPPQ()

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 415 of file alsaqueue.cpp.

◆ getRealBPM()

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 509 of file alsaqueue.cpp.

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

◆ getSkewBase()

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 437 of file alsaqueue.cpp.

◆ getSkewValue()

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 426 of file alsaqueue.cpp.

Referenced by QueueTempo::getRealBPM().

◆ getTempo()

unsigned int getTempo ( )

Gets the queue's tempo in microseconds per beat.

Returns
The queue's tempo in microseconds per beat.
Examples
drumgrid.cpp, and metronome.cpp.

Definition at line 446 of file alsaqueue.cpp.

Referenced by QueueTempo::getNominalBPM().

◆ operator=()

QueueTempo & operator= ( const QueueTempo other)

Assignment operator.

Parameters
otherAn existing QueueTempo object reference
Returns
This object

Definition at line 394 of file alsaqueue.cpp.

◆ setNominalBPM()

void setNominalBPM ( float  value)

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

Parameters
valueThe nominal tempo in BPM (beats per minute).
Examples
drumgrid.cpp, and metronome.cpp.

Definition at line 529 of file alsaqueue.cpp.

References QueueTempo::setTempo().

◆ setPPQ()

void setPPQ ( int  value)

Sets the queue resolution in parts per quarter note.

Parameters
valueThe queue resolution in PPQ.
Examples
drumgrid.cpp, and metronome.cpp.

Definition at line 455 of file alsaqueue.cpp.

◆ setSkewBase()

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 478 of file alsaqueue.cpp.

Referenced by QueueTempo::setTempoFactor().

◆ setSkewValue()

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 466 of file alsaqueue.cpp.

Referenced by QueueTempo::setTempoFactor().

◆ setTempo()

void setTempo ( unsigned int  value)

Sets the queue tempo in microseconds per beat.

Parameters
valueThe tempo in microseconds per beat

Definition at line 487 of file alsaqueue.cpp.

Referenced by QueueTempo::setNominalBPM().

◆ setTempoFactor()

void setTempoFactor ( float  value)

Sets the queue's tempo skew factor.

Parameters
valueThe tempo skew factor.

Definition at line 519 of file alsaqueue.cpp.

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


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