mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-06 15:19:29 +02:00
Fix new TruncateSilence -- be sure to iterate over the correct track list
This commit is contained in:
parent
cdc8142940
commit
74dc49a9e9
@ -320,7 +320,7 @@ bool EffectTruncSilence::ProcessIndependently()
|
|||||||
RegionList silences;
|
RegionList silences;
|
||||||
silences.DeleteContents(true);
|
silences.DeleteContents(true);
|
||||||
|
|
||||||
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;
|
||||||
@ -356,7 +356,7 @@ bool EffectTruncSilence::ProcessAll()
|
|||||||
silences.DeleteContents(true);
|
silences.DeleteContents(true);
|
||||||
|
|
||||||
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();
|
||||||
@ -370,7 +370,7 @@ 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
|
||||||
Region *sel = new Region;
|
Region *sel = new Region;
|
||||||
@ -379,7 +379,7 @@ bool EffectTruncSilence::FindSilences
|
|||||||
silences.push_back(sel);
|
silences.push_back(sel);
|
||||||
|
|
||||||
// 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())
|
||||||
|
@ -91,7 +91,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