1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-07-17 21:24:07 +00:00

With lots of logging arising temporarily, fixed bug whereby conversion to a patched track would lead to holding a track with a distinct measure of time, leading to improperly-placed patches.

This commit is contained in:
Thomas Harte
2016-12-25 22:00:39 -05:00
parent b538ee5bd8
commit 742c5df367
5 changed files with 19 additions and 11 deletions

View File

@@ -166,11 +166,15 @@ void Controller::end_writing()
if(!patched_track_)
{
// TODO: is the track already actually a patched track?
// see dynamic_pointer_cast
patched_track_.reset(new PCMPatchedTrack(track_));
// Avoid creating a new patched track if this one is already patched
patched_track_ = std::dynamic_pointer_cast<PCMPatchedTrack>(track_);
if(!patched_track_)
{
patched_track_.reset(new PCMPatchedTrack(track_));
}
}
patched_track_->add_segment(write_start_time_, write_segment_);
invalidate_track(); // TEMPORARY: to force a seek
}
#pragma mark - PLL control and delegate