PS04RhythmClock

PS04RhythmClock — base class for rhythm clocks

Synopsis


#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);

Description

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().

Details

PS04RhythmClock

typedef struct {
  GObject parent;

  gulong tick;
  const GList *next_event_node;
  const GList *events;
  long ticks_to_next_event;
} PS04RhythmClock;


ps04_rhythm_clock_get_position ()

unsigned    ps04_rhythm_clock_get_position  (const PS04RhythmClock *self);

Gets the accumulated tick count.

self : A PS04RhythmClock.
Returns : a tick count.

ps04_rhythm_clock_get_ticks_to_next_event ()

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.

ps04_rhythm_clock_set_events ()

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.

ps04_rhythm_clock_tick ()

void        ps04_rhythm_clock_tick          (PS04RhythmClock *self);

Triggers a tick of the clock.

self : A PS04RhythmClock.

See Also

PS04RhythmEvent