drumstick 2.9.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. | |
QueueTempo * | clone () |
Copy the current object returning the copied object. More... | |
QueueTempo & | operator= (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... | |
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).
Definition at line 129 of file alsaqueue.h.
QueueTempo | ( | const QueueTempo & | other | ) |
Copy constructor.
other | An existing QueueTempo object reference |
Definition at line 366 of file alsaqueue.cpp.
|
explicit |
Constructor.
other | An ALSA queue tempo object pointer |
Definition at line 356 of file alsaqueue.cpp.
QueueTempo * clone | ( | ) |
Copy the current object returning the copied object.
Definition at line 384 of file alsaqueue.cpp.
References QueueTempo::QueueTempo().
int getId | ( | ) |
Gets the queue's numeric identifier.
Definition at line 406 of file alsaqueue.cpp.
int getInfoSize | ( | ) | const |
Gets the size of the ALSA queue tempo object.
Definition at line 538 of file alsaqueue.cpp.
float getNominalBPM | ( | ) |
Gets the queue's nominal BPM tempo (in beats per minute)
Definition at line 496 of file alsaqueue.cpp.
References QueueTempo::getTempo().
Referenced by QueueTempo::getRealBPM().
int getPPQ | ( | ) |
Gets the PPQ (parts per quarter note) resolution of the queue.
Definition at line 415 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.
Definition at line 509 of file alsaqueue.cpp.
References QueueTempo::getNominalBPM(), QueueTempo::getSkewValue(), and drumstick::ALSA::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.
Definition at line 437 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.
Definition at line 426 of file alsaqueue.cpp.
Referenced by QueueTempo::getRealBPM().
unsigned int getTempo | ( | ) |
Gets the queue's tempo in microseconds per beat.
Definition at line 446 of file alsaqueue.cpp.
Referenced by QueueTempo::getNominalBPM().
QueueTempo & operator= | ( | const QueueTempo & | other | ) |
Assignment operator.
other | An existing QueueTempo object reference |
Definition at line 394 of file alsaqueue.cpp.
void setNominalBPM | ( | float | value | ) |
Sets the queue's nominal tempo in BPM (beats per minute).
value | The nominal tempo in BPM (beats per minute). |
Definition at line 529 of file alsaqueue.cpp.
References QueueTempo::setTempo().
void setPPQ | ( | int | value | ) |
Sets the queue resolution in parts per quarter note.
value | The queue resolution in PPQ. |
Definition at line 455 of file alsaqueue.cpp.
|
protected |
Sets the tempo skew base.
The real skew factor is the quotient of the skew value divided by the skew base.
value | The tempo skew base. |
Definition at line 478 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.
value | The tempo skew numerator. |
Definition at line 466 of file alsaqueue.cpp.
Referenced by QueueTempo::setTempoFactor().
void setTempo | ( | unsigned int | value | ) |
Sets the queue tempo in microseconds per beat.
value | The tempo in microseconds per beat |
Definition at line 487 of file alsaqueue.cpp.
Referenced by QueueTempo::setNominalBPM().
void setTempoFactor | ( | float | value | ) |
Sets the queue's tempo skew factor.
value | The tempo skew factor. |
Definition at line 519 of file alsaqueue.cpp.
References QueueTempo::setSkewBase(), QueueTempo::setSkewValue(), and drumstick::ALSA::SKEW_BASE.