mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-24 08:10:05 +02:00
Add some comments to the places I got confused. This would be much clearer if classes had copy-constructors\!
This commit is contained in:
parent
afbbcc179a
commit
389beeb7fc
@ -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);
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user