| GPS04 Reference Manual | ||||
|---|---|---|---|---|
#include <PS04-counter.h>
PS04Counter;
PS04Counter* ps04_counter_new (void);
void ps04_counter_add_ticks (PS04Counter *self,
gulong ticks);
guint ps04_counter_get_beats_per_measure
(const PS04Counter *self);
void ps04_counter_get_measure_beat_tick
(const PS04Counter *self,
guint *measure,
guint *beat,
guint *tick);
gulong ps04_counter_get_n_ticks (const PS04Counter *self);
char* ps04_counter_get_position_string
(const PS04Counter *self);
void ps04_counter_set_beats_per_measure
(PS04Counter *self,
guint beats);
The PS04Counter class keeps track of where you are in a rhythm pattern
or song. It accumulates ticks (1/48 of a quarter note) and calculates a
measure-beat-tick position from the current total. Time signature changes,
set by ps04_counter_set_beats_per_measure(), are supported at any point
during the tick accumulation - although you'd normally
want to reset it at measure boundaries only.
PS04Counter* ps04_counter_new (void);
Creates a new counter.
| Returns : | a new PS04Counter object. |
void ps04_counter_add_ticks (PS04Counter *self, gulong ticks);
Adds a number of ticks to the counter.
self : |
a PS04Counter. |
ticks : |
the number of ticks to add. |
guint ps04_counter_get_beats_per_measure
(const PS04Counter *self);
self : |
|
| Returns : |
void ps04_counter_get_measure_beat_tick
(const PS04Counter *self,
guint *measure,
guint *beat,
guint *tick);
Gets the current counter position as a measure-beat-tick combo. Note that all values are 0-based, although you should make measure and beat values 1-based when shown to the user.
self : |
a PS04Counter. |
measure : |
pointer to a guint to receive the current measure (0-based). |
beat : |
pointer to a guint to receive the current beat (0-based). |
tick : |
pointer to a guint to receive the current tick (0-based),
or NULL if this is of no interest (song events are always
on beat boundaries and thus get zero tick values).
|
gulong ps04_counter_get_n_ticks (const PS04Counter *self);
Gets the current accumulated tick count.
self : |
a PS04Counter. |
| Returns : | the tick count. |
char* ps04_counter_get_position_string
(const PS04Counter *self);
self : |
|
| Returns : |
void ps04_counter_set_beats_per_measure
(PS04Counter *self,
guint beats);
Sets the number of beats per measure from the current position and onwards.
self : |
a PS04Counter. |
beats : |
the number of beats per measure (1-8). |