mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-25 03:32:01 +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:
parent
9cb902cc4f
commit
af1b396c9e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user