1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 16:40:07 +02:00

Bug 2215 - Cut does not work when in Pause mode

In bool MenuManager::TryToMakeActionAllowed(), there's the condition:
(MissingFlags & enabler.possibleFlags()) == MissingFlags

that is, the missing flags has to be a subset of the possible flags.
For cut in pause mode, this condition is not met for the enabler stopIfPaused, because MissingFlags also includes the CutCopyAvailableFlag, which is not one of the enabler's possible flags.
It is not sensible for the missing flags to have to be a subset of the possible flags, because for this to work, for each enabler the possible flags would have to include other flags that could need fixing by other enablers.

Fix:
1. Change the condition to the intersection of the missing flags and possible flags is non-empty.
2. In CutCopyAvailableFlag, remove the condition !AudioIOBusyPred(). If this is present, then due to the first change, paused audio could cause all audio to be selected even when there was a selection. The commands for which this flag is used are cut and copy, and they already have AudioIONotBusy flags, so this change should not affect previous behaviour.
This commit is contained in:
David Bailes 2019-10-02 10:39:15 +01:00
parent b06af2330b
commit 9e51dba3db
2 changed files with 1 additions and 3 deletions

View File

@ -661,7 +661,7 @@ bool MenuManager::TryToMakeActionAllowed(
(flags & actual) == actual
&&
// Can we get the condition we need?
(MissingFlags & enabler.possibleFlags()) == MissingFlags
(MissingFlags & enabler.possibleFlags()).any()
) {
// Then try the function
enabler.tryEnable( project, flagsRqd );

View File

@ -1011,8 +1011,6 @@ const ReservedCommandFlag
return true;
if (
!AudioIOBusyPred( project )
&&
TimeSelectedPred( project )
&&
TracksSelectedPred( project )