diff --git a/src/TimeTrack.cpp b/src/TimeTrack.cpp index 45bc6f3d6..29da30d71 100644 --- a/src/TimeTrack.cpp +++ b/src/TimeTrack.cpp @@ -59,8 +59,9 @@ TimeTrack::TimeTrack(DirManager *projDirManager): TimeTrack::TimeTrack(TimeTrack &orig): Track(orig) { - Init(orig); + Init(orig); // this copies the TimeTrack metadata (name, range, etc) + ///@TODO: Give Envelope:: a copy-constructor instead of this? mEnvelope = new Envelope(); mEnvelope->SetTrackLen(1000000000.0); SetInterpolateLog(orig.GetInterpolateLog()); // this calls Envelope::SetInterpolateDB @@ -70,6 +71,7 @@ TimeTrack::TimeTrack(TimeTrack &orig): mEnvelope->SetRange(orig.mEnvelope->GetMinValue(), orig.mEnvelope->GetMaxValue()); mEnvelope->Paste(0.0, orig.mEnvelope); + ///@TODO: Give Ruler:: a copy-constructor instead of this? mRuler = new Ruler(); mRuler->SetLabelEdges(false); mRuler->SetFormat(Ruler::TimeFormat); diff --git a/src/TimeTrack.h b/src/TimeTrack.h index 488e756c4..058ef5620 100644 --- a/src/TimeTrack.h +++ b/src/TimeTrack.h @@ -27,6 +27,13 @@ class TimeTrack: public Track { public: TimeTrack(DirManager * projDirManager); + /** @brief Copy-Constructor - create a new TimeTrack:: which is an independent copy of the original + * + * Calls TimeTrack::Init() to copy the track metadata, then does a bunch of manipulations on the + * Envelope:: and Ruler:: members in order to copy one to the other - unfortunately both lack a + * copy-constructor to encapsulate this. + * @param orig The original track to copy from + */ TimeTrack(TimeTrack &orig); virtual ~TimeTrack(); @@ -102,6 +109,11 @@ class TimeTrack: public Track { bool mDisplayLog; bool mRescaleXMLValues; // needed for backward-compatibility with older project files + /** @brief Copy the metadata from another track but not the points + * + * Copies the Name, DefaultName, Range and Display data from the source track + * @param orig the TimeTrack to copy from + */ void Init(const TimeTrack &orig); virtual Track *Duplicate();