mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-06 03:32:09 +01:00
void return, not boolean success, from some Track virtual functions...
... The return codes were mostly ignored anyway, and exceptions will be thrown instead. It seems there was also confusion whether the return values of Track::Paste and Track::SyncLockAdjust were to indicate success or indicate whether there was any change. No matter now.
This commit is contained in:
@@ -153,7 +153,7 @@ void LabelTrack::SetOffset(double dOffset)
|
||||
labelStruct.selectedRegion.move(dOffset);
|
||||
}
|
||||
|
||||
bool LabelTrack::Clear(double b, double e)
|
||||
void LabelTrack::Clear(double b, double e)
|
||||
{
|
||||
// May DELETE labels, so use subscripts to iterate
|
||||
for (size_t i = 0; i < mLabels.size(); ++i) {
|
||||
@@ -175,8 +175,6 @@ bool LabelTrack::Clear(double b, double e)
|
||||
else if (relation == LabelStruct::WITHIN_LABEL)
|
||||
labelStruct.selectedRegion.moveT1( - (e-b));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -2340,9 +2338,7 @@ Track::Holder LabelTrack::Cut(double t0, double t1)
|
||||
{
|
||||
auto tmp = Copy(t0, t1);
|
||||
|
||||
if (!Clear(t0, t1))
|
||||
//THROW_INCONSISTENCY_EXCEPTION
|
||||
;
|
||||
Clear(t0, t1);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
@@ -2416,6 +2412,7 @@ Track::Holder LabelTrack::Copy(double t0, double t1, bool) const
|
||||
bool LabelTrack::PasteOver(double t, const Track * src)
|
||||
{
|
||||
if (src->GetKind() != Track::Label)
|
||||
// THROW_INCONSISTENCY_EXCEPTION; // ?
|
||||
return false;
|
||||
|
||||
int len = mLabels.size();
|
||||
@@ -2439,17 +2436,18 @@ bool LabelTrack::PasteOver(double t, const Track * src)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LabelTrack::Paste(double t, const Track *src)
|
||||
void LabelTrack::Paste(double t, const Track *src)
|
||||
{
|
||||
if (src->GetKind() != Track::Label)
|
||||
return false;
|
||||
// THROW_INCONSISTENCY_EXCEPTION; // ?
|
||||
return;
|
||||
|
||||
LabelTrack *lt = (LabelTrack *)src;
|
||||
|
||||
double shiftAmt = lt->mClipLen > 0.0 ? lt->mClipLen : lt->GetEndTime();
|
||||
|
||||
ShiftLabelsOnInsert(shiftAmt, t);
|
||||
return PasteOver(t, src);
|
||||
PasteOver(t, src);
|
||||
}
|
||||
|
||||
// This repeats the labels in a time interval a specified number of times.
|
||||
@@ -2505,7 +2503,7 @@ bool LabelTrack::Repeat(double t0, double t1, int n)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LabelTrack::Silence(double t0, double t1)
|
||||
void LabelTrack::Silence(double t0, double t1)
|
||||
{
|
||||
int len = mLabels.size();
|
||||
|
||||
@@ -2549,11 +2547,9 @@ bool LabelTrack::Silence(double t0, double t1)
|
||||
}
|
||||
|
||||
SortLabels();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LabelTrack::InsertSilence(double t, double len)
|
||||
void LabelTrack::InsertSilence(double t, double len)
|
||||
{
|
||||
for (auto &labelStruct: mLabels) {
|
||||
double t0 = labelStruct.getT0();
|
||||
@@ -2565,8 +2561,6 @@ bool LabelTrack::InsertSilence(double t, double len)
|
||||
t1 += len;
|
||||
labelStruct.selectedRegion.setTimes(t0, t1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int LabelTrack::GetNumLabels() const
|
||||
|
||||
Reference in New Issue
Block a user