mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-13 07:30:21 +00:00
Period
s need a custom copy constructor too, if they're going to avoid sharing an event_source.
This commit is contained in:
parent
e5cc77f22d
commit
5d63556870
@ -224,6 +224,12 @@ Storage::Time PCMPatchedTrack::seek_to(const Time &time_since_index_hole)
|
|||||||
return current_time_;
|
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)
|
void PCMPatchedTrack::Period::push_start_to_time(const Storage::Time &new_start_time)
|
||||||
{
|
{
|
||||||
segment_start_time += new_start_time - start_time;
|
segment_start_time += new_start_time - start_time;
|
||||||
|
@ -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) :
|
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) {}
|
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> periods_;
|
||||||
std::vector<Period>::iterator active_period_;
|
std::vector<Period>::iterator active_period_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user