![]() |
![]() |
![]() |
GPS04 Reference Manual | ![]() |
---|---|---|---|---|
#include <PS04-rhythm-clock.h> PS04RhythmClock; unsigned ps04_rhythm_clock_get_position (const PS04RhythmClock *self); long ps04_rhythm_clock_get_ticks_to_next_event (const PS04RhythmClock *self); void ps04_rhythm_clock_set_events (PS04RhythmClock *self, const GList *events); void ps04_rhythm_clock_tick (PS04RhythmClock *self);
The PS04RhythmClock class is the base for pattern and song clocks. It
keeps track of a list of PS04RhythmEvent and calls a virtual function
process_event()
when appropriate. You feed it an external pulse with
ps04_rhythm_clock_tick()
.
typedef struct { GObject parent; gulong tick; const GList *next_event_node; const GList *events; long ticks_to_next_event; } PS04RhythmClock;
unsigned ps04_rhythm_clock_get_position (const PS04RhythmClock *self);
Gets the accumulated tick count.
self : |
A PS04RhythmClock. |
Returns : | a tick count. |
long ps04_rhythm_clock_get_ticks_to_next_event (const PS04RhythmClock *self);
Gets the number of ticks to next event.
self : |
A PS04RhythmClock. |
Returns : | a tick count, or -1 if no events are left. |
void ps04_rhythm_clock_set_events (PS04RhythmClock *self, const GList *events);
Sets the event list to be checked for every tick. This is normally used by derived classes.
self : |
A PS04RhythmClock. |
events : |
A GList of PS04RhythmEvent. |
void ps04_rhythm_clock_tick (PS04RhythmClock *self);
Triggers a tick of the clock.
self : |
A PS04RhythmClock. |