There is even a prototype in src/sound/JackDriver.h for the needed callback, and it would probably look something like this:
int new_pos, void arg)
Composition *comp = INSERT MAGIC HERE TO GET A POINTER TO THE COMPOSITION timeT t = comp->getPosition(); comp->getMusicalTimeForAbsoluteTime(t, pos->bar, pos->beat, int &fraction, int &remainder); pos->tick = fraction; pos->ticks_per_beat = fraction + remainder; TimeSignature ts = comp->getTimeSignatureAt(t); pos->beats_per_bar = ts->getNumerator(); pos->beat_type = 1 << (6-ts->getDenominator()); // Ugly hack warning! pos->beats_per_minute = Composition::getTempoQpm(comp->getCurrentTempo()); pos->valid = JackPositionBBT; // + JackBBTFrameOffset when we get deeper into the details?
Of course I never got as far as feeding this to the compiler, the most crucial part is missing. So the C++ might be a bit off (not my strongest language) but I hope this saves some developer a few minutes if this gets implemented.
Log in to post a comment.