mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
Small optimization - non-linear preview copies only selected tracks by default.
This commit is contained in:
parent
d9f3c432d4
commit
fbaab8702e
@ -92,6 +92,7 @@ Effect::Effect()
|
||||
mT1 = 0.0;
|
||||
mDuration = 0.0;
|
||||
mIsLinearEffect = false;
|
||||
mPreviewWithNotSelected = false;
|
||||
mNumTracks = 0;
|
||||
mNumGroups = 0;
|
||||
mProgress = NULL;
|
||||
@ -1938,6 +1939,11 @@ void Effect::SetLinearEffectFlag(bool linearEffectFlag)
|
||||
mIsLinearEffect = linearEffectFlag;
|
||||
}
|
||||
|
||||
void Effect::IncludeNotSelectedPreviewTracks(bool includeNotSelected)
|
||||
{
|
||||
mPreviewWithNotSelected = includeNotSelected;
|
||||
}
|
||||
|
||||
bool Effect::TotalProgress(double frac)
|
||||
{
|
||||
int updateResult = (mProgress ?
|
||||
@ -2432,17 +2438,17 @@ void Effect::Preview(bool dryOnly)
|
||||
t1 = mixLeft->GetEndTime();
|
||||
}
|
||||
else {
|
||||
// Copy all tracks as 'some' effects (AutoDuck) may require non-selected tracks.
|
||||
TrackListOfKindIterator iter(Track::Wave, saveTracks);
|
||||
WaveTrack *src = (WaveTrack *) iter.First();
|
||||
while (src)
|
||||
{
|
||||
WaveTrack *dest;
|
||||
src->Copy(t0, t1, (Track **) &dest);
|
||||
dest->SetSelected(src->GetSelected());
|
||||
dest->SetDisplay(WaveTrack::NoDisplay);
|
||||
mTracks->Add(dest);
|
||||
|
||||
if (src->GetSelected() || mPreviewWithNotSelected) {
|
||||
src->Copy(t0, t1, (Track **) &dest);
|
||||
dest->SetSelected(src->GetSelected());
|
||||
dest->SetDisplay(WaveTrack::NoDisplay);
|
||||
mTracks->Add(dest);
|
||||
}
|
||||
src = (WaveTrack *) iter.Next();
|
||||
}
|
||||
}
|
||||
|
@ -321,6 +321,11 @@ protected:
|
||||
// To allow pre-mixing before Preview, set linearEffectFlag to true.
|
||||
void SetLinearEffectFlag(bool linearEffectFlag);
|
||||
|
||||
// Most effects only require selected tracks to be copied for Preview.
|
||||
// If IncludeNotSelectedPreviewTracks(true), then non-linear effects have
|
||||
// preview copies of all wave tracks.
|
||||
void IncludeNotSelectedPreviewTracks(bool includeNotSelected);
|
||||
|
||||
// Use these two methods to copy the input tracks to mOutputTracks, if
|
||||
// doing the processing on them, and replacing the originals only on success (and not cancel).
|
||||
void CopyInputTracks(int trackType = Track::Wave);
|
||||
@ -394,6 +399,7 @@ private:
|
||||
bool mIsBatch;
|
||||
|
||||
bool mIsLinearEffect;
|
||||
bool mPreviewWithNotSelected;
|
||||
|
||||
double mDuration;
|
||||
// mSetDuration should ONLY be set when SetDuration() is called.
|
||||
|
Loading…
x
Reference in New Issue
Block a user