1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Fixed insertion location finding logic, working on the relevant test.

This commit is contained in:
Thomas Harte 2016-12-20 21:14:05 -05:00
parent c180340474
commit 7eca910cc5
2 changed files with 2 additions and 3 deletions

View File

@ -158,8 +158,7 @@
if(events.back().type == Storage::Disk::Track::Event::IndexHole) break;
}
XCTAssert(events.size() == 17, @"Should still be 17 total events");
XCTAssert(events[16].length == Storage::Time(33, 64), @"Final event should take 33/64");
XCTAssert(events.size() == 33, @"Should still be 33 total events");
XCTAssert(total_length == Storage::Time(1), @"Total track length should still be 1");
}

View File

@ -51,7 +51,7 @@ void PCMPatchedTrack::insert_period(const Period &period)
{
// find the existing period that the new period starts in
std::vector<Period>::iterator start_period = periods_.begin();
while(start_period->start_time >= period.end_time) start_period++;
while(start_period->end_time <= period.start_time) start_period++;
// find the existing period that the new period end in
std::vector<Period>::iterator end_period = start_period;