mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-19 09:30:06 +02:00
Nyquist can now make a selection and not have it overwritten by Effect.
This commit is contained in:
parent
3d0d28eb03
commit
57c50ff9ac
@ -61,6 +61,10 @@ bool SelectTimeCommand::Apply(const CommandContext & context){
|
||||
if( !bHasT0 && !bHasT1 )
|
||||
return true;
|
||||
|
||||
// Count selection as a do-nothing effect.
|
||||
// Used to invalidate cached selection and tracks.
|
||||
Effect::IncEffectCounter();
|
||||
|
||||
if( mFromEnd ){
|
||||
double TEnd = context.GetProject()->GetTracks()->GetEndTime();
|
||||
context.GetProject()->mViewInfo.selectedRegion.setTimes(TEnd - mT0, TEnd - mT1);
|
||||
@ -110,6 +114,11 @@ bool SelectTracksCommand::Apply(const CommandContext &context)
|
||||
{
|
||||
if( !bHasFirstTrack && !bHasLastTrack )
|
||||
return true;
|
||||
|
||||
// Count selection as a do-nothing effect.
|
||||
// Used to invalidate cached selection and tracks.
|
||||
Effect::IncEffectCounter();
|
||||
|
||||
int index = 0;
|
||||
TrackList *tracks = context.GetProject()->GetTracks();
|
||||
int last = wxMax( mFirstTrack, mLastTrack );
|
||||
|
@ -1266,7 +1266,7 @@ bool Effect::DoEffect(wxWindow *parent,
|
||||
returnVal = Process();
|
||||
}
|
||||
|
||||
if (returnVal)
|
||||
if (returnVal && (mT1 >= mT0 ))
|
||||
{
|
||||
selectedRegion->setTimes(mT0, mT1);
|
||||
}
|
||||
|
@ -269,6 +269,8 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
|
||||
long style = DefaultMessageBoxStyle,
|
||||
const wxString& titleStr = wxString{});
|
||||
|
||||
static void IncEffectCounter(){ nEffectsDone++;};
|
||||
|
||||
//
|
||||
// protected virtual methods
|
||||
//
|
||||
|
@ -859,8 +859,10 @@ _("Selection too long for Nyquist code.\nMaximum allowed selection is %ld sample
|
||||
// Has rug been pulled from under us by some effect done within Nyquist??
|
||||
if( nEffectsSoFar == nEffectsDone )
|
||||
ReplaceProcessedTracks(success);
|
||||
else
|
||||
else{
|
||||
ReplaceProcessedTracks(false); // Do not use the results.
|
||||
mT1 = mT0 - 1.0;// And don't use the times either, in resetting the selection (make them bogus).
|
||||
}
|
||||
|
||||
if (!mProjectChanged)
|
||||
em.SetSkipStateFlag(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user