1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 05:29:23 +00:00

Found an ugly issue with Storage::Time as implemented (i) to be unsigned; and (ii) automatically to simplify. Will need to fix. Here's a quick workaround for this one segment of code.

This commit is contained in:
Thomas Harte 2016-12-28 22:57:11 -05:00
parent 9cb902cc4f
commit af1b396c9e

View File

@ -155,13 +155,17 @@ Track::Event PCMPatchedTrack::get_next_event()
// see what time that gets us to. If it's still within the current period, return the found event
Time event_time = current_time_ + event.length - period_error - insertion_error_;
insertion_error_.set_zero();
if(event_time < active_period_->end_time)
{
current_time_ = event_time;
event.length += extra_time - period_error;
// TODO: this is spelt out in three steps because times don't necessarily do the sensible
// thing when 'negative' if intermediate result get simplified in the meantime. So fix Time.
event.length += extra_time;
event.length -= period_error;
event.length -= insertion_error_;
return event;
}
insertion_error_.set_zero();
// otherwise move time back to the end of the outgoing period, accumulating the error into
// extra_time, and advance the extra period