mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-20 14:47:49 +02:00
Fix new TruncateSilence -- be sure to iterate over the correct track list
This commit is contained in:
commit
911513fefe
@ -314,7 +314,7 @@ bool EffectTruncSilence::ProcessIndependently()
|
|||||||
|
|
||||||
RegionList silences;
|
RegionList silences;
|
||||||
|
|
||||||
if (!FindSilences(silences, track, last))
|
if (!FindSilences(silences, mOutputTracks, track, last))
|
||||||
return false;
|
return false;
|
||||||
// Treat tracks in the sync lock group only
|
// Treat tracks in the sync lock group only
|
||||||
Track *groupFirst, *groupLast;
|
Track *groupFirst, *groupLast;
|
||||||
@ -349,7 +349,7 @@ bool EffectTruncSilence::ProcessAll()
|
|||||||
RegionList silences;
|
RegionList silences;
|
||||||
|
|
||||||
SelectedTrackListOfKindIterator iter(Track::Wave, mTracks);
|
SelectedTrackListOfKindIterator iter(Track::Wave, mTracks);
|
||||||
if (FindSilences(silences, iter.First(), iter.Last())) {
|
if (FindSilences(silences, mTracks, iter.First(), iter.Last())) {
|
||||||
TrackListIterator iterOut(mOutputTracks);
|
TrackListIterator iterOut(mOutputTracks);
|
||||||
double totalCutLen = 0.0;
|
double totalCutLen = 0.0;
|
||||||
Track *const first = iterOut.First();
|
Track *const first = iterOut.First();
|
||||||
@ -363,13 +363,13 @@ bool EffectTruncSilence::ProcessAll()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool EffectTruncSilence::FindSilences
|
bool EffectTruncSilence::FindSilences
|
||||||
(RegionList &silences, Track *firstTrack, Track *lastTrack)
|
(RegionList &silences, TrackList *list, Track *firstTrack, Track *lastTrack)
|
||||||
{
|
{
|
||||||
// Start with the whole selection silent
|
// Start with the whole selection silent
|
||||||
silences.push_back(Region(mT0, mT1));
|
silences.push_back(Region(mT0, mT1));
|
||||||
|
|
||||||
// Remove non-silent regions in each track
|
// Remove non-silent regions in each track
|
||||||
SelectedTrackListOfKindIterator iter(Track::Wave, mTracks);
|
SelectedTrackListOfKindIterator iter(Track::Wave, list);
|
||||||
int whichTrack = 0;
|
int whichTrack = 0;
|
||||||
bool lastSeen = false;
|
bool lastSeen = false;
|
||||||
for (Track *t = iter.StartWith(firstTrack); !lastSeen && t; t = iter.Next())
|
for (Track *t = iter.StartWith(firstTrack); !lastSeen && t; t = iter.Next())
|
||||||
|
@ -88,7 +88,7 @@ private:
|
|||||||
bool ProcessIndependently();
|
bool ProcessIndependently();
|
||||||
bool ProcessAll();
|
bool ProcessAll();
|
||||||
bool FindSilences
|
bool FindSilences
|
||||||
(RegionList &silences, Track *firstTrack, Track *lastTrack);
|
(RegionList &silences, TrackList *list, Track *firstTrack, Track *lastTrack);
|
||||||
bool DoRemoval
|
bool DoRemoval
|
||||||
(const RegionList &silences, unsigned iGroup, unsigned nGroups, Track *firstTrack, Track *lastTrack,
|
(const RegionList &silences, unsigned iGroup, unsigned nGroups, Track *firstTrack, Track *lastTrack,
|
||||||
double &totalCutLen);
|
double &totalCutLen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user