#include "clip.hh"
Public Types | |
using | Receiver = std::function< void(int64 tick, MidiEvent &event)> |
Public Member Functions | |
int64 | clip_position () const |
bool | done () const |
int64 | generate (int64 target_tick, const Receiver &receiver) |
Generator ()=default | |
void | jumpto (int64 target_tick) |
int64 | loop_end () const |
int64 | loop_start () const |
bool | muted () const |
void | muted (bool b) |
int64 | play_length () const |
int64 | play_position () const |
void | setup (const ClipImpl &clip) |
int64 | start_offset () const |
Generator for MIDI events.
Handler for generated MIDI events.
|
explicitdefault |
void setup | ( | const ClipImpl & | clip | ) |
Create generator from clip.
void jumpto | ( | int64 | target_tick | ) |
Assign new play_position() (and clip_position()), preserves all other state.
Advance tick and call `receiver` for generated events.
bool muted | ( | ) | const |
Mute MIDI note generation.
void muted | ( | bool | b | ) |
Assign muted state.
int64 start_offset | ( | ) | const |
Initial offset in ticks.
int64 loop_start | ( | ) | const |
Loop start in ticks.
int64 loop_end | ( | ) | const |
Loop end in ticks.
int64 play_length | ( | ) | const |
Maximum amount of ticks during playback.
int64 play_position | ( | ) | const |
Current playback position in ticks.
bool done | ( | ) | const |
Check if playback is done.
int64 clip_position | ( | ) | const |
Position within clip as tick.