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