1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

Periods need a custom copy constructor too, if they're going to avoid sharing an event_source.

This commit is contained in:
Thomas Harte 2016-12-30 17:39:52 -05:00
parent e5cc77f22d
commit 5d63556870
2 changed files with 7 additions and 0 deletions

View File

@ -224,6 +224,12 @@ Storage::Time PCMPatchedTrack::seek_to(const Time &time_since_index_hole)
return current_time_;
}
PCMPatchedTrack::Period::Period(const Period &original) :
start_time(original.start_time), end_time(original.end_time), segment_start_time(original.segment_start_time)
{
if(original.event_source) event_source.reset(new PCMSegmentEventSource(*original.event_source));
}
void PCMPatchedTrack::Period::push_start_to_time(const Storage::Time &new_start_time)
{
segment_start_time += new_start_time - start_time;

View File

@ -55,6 +55,7 @@ class PCMPatchedTrack: public Track {
Period(const Time &start_time, const Time &end_time, const Time &segment_start_time, std::shared_ptr<PCMSegmentEventSource> event_source) :
start_time(start_time), end_time(end_time), segment_start_time(segment_start_time), event_source(event_source) {}
Period(const Period &);
};
std::vector<Period> periods_;
std::vector<Period>::iterator active_period_;