1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-22 16:41:18 +01:00

More const qualifiers, for copying of tracks, and replacing in lists of tracks

... (the tracks may be const, not the list, when replacing)
This commit is contained in:
Paul Licameli
2016-02-27 17:29:21 -05:00
parent 36f3f8aab2
commit 48a5f55179
11 changed files with 35 additions and 24 deletions

View File

@@ -623,7 +623,7 @@ bool WaveTrack::Trim (double t0, double t1)
bool WaveTrack::Copy(double t0, double t1, Track **dest)
bool WaveTrack::Copy(double t0, double t1, Track **dest) const
{
*dest = NULL;
@@ -636,9 +636,9 @@ bool WaveTrack::Copy(double t0, double t1, Track **dest)
WaveClipList::compatibility_iterator it;
for (it=GetClipIterator(); it; it=it->GetNext())
for (it = const_cast<WaveTrack*>(this)->GetClipIterator(); it; it = it->GetNext())
{
WaveClip *clip = it->GetData();
const WaveClip *clip = it->GetData();
if (t0 <= clip->GetStartTime() && t1 >= clip->GetEndTime())
{
@@ -713,6 +713,11 @@ bool WaveTrack::Copy(double t0, double t1, Track **dest)
return true;
}
bool WaveTrack::CopyNonconst(double t0, double t1, Track **dest)
{
return Copy(t0, t1, dest);
}
bool WaveTrack::Clear(double t0, double t1)
{
return HandleClear(t0, t1, false, false);