1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-25 11:17:26 +00:00

Converts Time::get into a template, introduces a via-a-double fallback for the timed event loop.

This commit is contained in:
Thomas Harte
2018-04-25 19:54:39 -04:00
parent b4f6dee954
commit 4c6dc597f4
11 changed files with 36 additions and 22 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ Storage::Time PCMSegmentEventSource::seek_to(const Time &time_from_start) {
// bit_pointer_ always records _the next bit_ that might trigger an event,
// so should be one beyond the one reached by a seek.
Time relative_time = time_from_start - half_bit_length;
bit_pointer_ = 1 + (relative_time / segment_->length_of_a_bit).get_unsigned_int();
bit_pointer_ = 1 + (relative_time / segment_->length_of_a_bit).get<unsigned int>();
// map up to the correct amount of time
return half_bit_length + segment_->length_of_a_bit * static_cast<unsigned int>(bit_pointer_ - 1);