|
@ -39,6 +39,37 @@ namespace Heck { |
|
|
ld::AudioHandle::InterleavingOutputBuffer out, |
|
|
ld::AudioHandle::InterleavingOutputBuffer out, |
|
|
size_t size); |
|
|
size_t size); |
|
|
|
|
|
|
|
|
|
|
|
void midi_realtime_handler(ld::MidiEvent& msg); |
|
|
|
|
|
|
|
|
|
|
|
struct Clock { |
|
|
|
|
|
void advance() |
|
|
|
|
|
{ |
|
|
|
|
|
if (enabled) { |
|
|
|
|
|
time++; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
void reset() |
|
|
|
|
|
{ |
|
|
|
|
|
time = 0; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
void enable(bool enabled) |
|
|
|
|
|
{ |
|
|
|
|
|
this->enabled = enabled; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
int gettime() |
|
|
|
|
|
{ |
|
|
|
|
|
return time; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
|
bool enabled{ true }; |
|
|
|
|
|
int time{ 0 }; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Clock clock{}; |
|
|
|
|
|
|
|
|
void init() |
|
|
void init() |
|
|
{ |
|
|
{ |
|
|