mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-20 14:20:06 +02:00
3rd arg of TryToMakeActionAllows always == 2nd; eliminate it
This commit is contained in:
parent
e5a786c420
commit
94d9593df8
@ -900,7 +900,7 @@ bool MenuManager::ReportIfActionNotAllowed(
|
|||||||
const wxString & Name, CommandFlag & flags, CommandFlag flagsRqd )
|
const wxString & Name, CommandFlag & flags, CommandFlag flagsRqd )
|
||||||
{
|
{
|
||||||
auto &project = mProject;
|
auto &project = mProject;
|
||||||
bool bAllowed = TryToMakeActionAllowed( flags, flagsRqd, flagsRqd );
|
bool bAllowed = TryToMakeActionAllowed( flags, flagsRqd );
|
||||||
if( bAllowed )
|
if( bAllowed )
|
||||||
return true;
|
return true;
|
||||||
auto &cm = CommandManager::Get( project );
|
auto &cm = CommandManager::Get( project );
|
||||||
@ -913,7 +913,7 @@ bool MenuManager::ReportIfActionNotAllowed(
|
|||||||
/// If not, then try some recovery action to make it so.
|
/// If not, then try some recovery action to make it so.
|
||||||
/// @return whether compatible or not after any actions taken.
|
/// @return whether compatible or not after any actions taken.
|
||||||
bool MenuManager::TryToMakeActionAllowed(
|
bool MenuManager::TryToMakeActionAllowed(
|
||||||
CommandFlag & flags, CommandFlag flagsRqd, CommandFlag mask )
|
CommandFlag & flags, CommandFlag flagsRqd )
|
||||||
{
|
{
|
||||||
auto &project = mProject;
|
auto &project = mProject;
|
||||||
bool bAllowed;
|
bool bAllowed;
|
||||||
@ -921,19 +921,19 @@ bool MenuManager::TryToMakeActionAllowed(
|
|||||||
if( flags.none() )
|
if( flags.none() )
|
||||||
flags = GetUpdateFlags();
|
flags = GetUpdateFlags();
|
||||||
|
|
||||||
bAllowed = ((flags & mask) == (flagsRqd & mask));
|
bAllowed = ((flags & flagsRqd) == flagsRqd);
|
||||||
if( bAllowed )
|
if( bAllowed )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Why is action not allowed?
|
// Why is action not allowed?
|
||||||
// 1's wherever a required flag is missing.
|
// 1's wherever a required flag is missing.
|
||||||
auto MissingFlags = (~flags & flagsRqd) & mask;
|
auto MissingFlags = (~flags & flagsRqd);
|
||||||
|
|
||||||
if( mStopIfWasPaused && (MissingFlags & AudioIONotBusyFlag ).any() ){
|
if( mStopIfWasPaused && (MissingFlags & AudioIONotBusyFlag ).any() ){
|
||||||
TransportActions::StopIfPaused( project );
|
TransportActions::StopIfPaused( project );
|
||||||
// Hope this will now reflect stopped audio.
|
// Hope this will now reflect stopped audio.
|
||||||
flags = GetUpdateFlags();
|
flags = GetUpdateFlags();
|
||||||
bAllowed = ((flags & mask) == (flagsRqd & mask));
|
bAllowed = ((flags & flagsRqd) == flagsRqd);
|
||||||
if( bAllowed )
|
if( bAllowed )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -949,7 +949,7 @@ bool MenuManager::TryToMakeActionAllowed(
|
|||||||
|
|
||||||
// Why is action still not allowed?
|
// Why is action still not allowed?
|
||||||
// 0's wherever a required flag is missing (or is don't care)
|
// 0's wherever a required flag is missing (or is don't care)
|
||||||
MissingFlags = (flags & ~flagsRqd) & mask;
|
MissingFlags = (flags & ~flagsRqd) & flagsRqd;
|
||||||
|
|
||||||
// IF selecting all audio won't do any good, THEN return with failure.
|
// IF selecting all audio won't do any good, THEN return with failure.
|
||||||
if( (flags & WaveTracksExistFlag).none() )
|
if( (flags & WaveTracksExistFlag).none() )
|
||||||
@ -967,6 +967,6 @@ bool MenuManager::TryToMakeActionAllowed(
|
|||||||
// So changed to DoSelectAllAudio.
|
// So changed to DoSelectAllAudio.
|
||||||
SelectActions::DoSelectAllAudio(project);
|
SelectActions::DoSelectAllAudio(project);
|
||||||
flags = GetUpdateFlags();
|
flags = GetUpdateFlags();
|
||||||
bAllowed = ((flags & mask) == (flagsRqd & mask));
|
bAllowed = ((flags & flagsRqd) == flagsRqd);
|
||||||
return bAllowed;
|
return bAllowed;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ public:
|
|||||||
bool ReportIfActionNotAllowed(
|
bool ReportIfActionNotAllowed(
|
||||||
const wxString & Name, CommandFlag & flags, CommandFlag flagsRqd );
|
const wxString & Name, CommandFlag & flags, CommandFlag flagsRqd );
|
||||||
bool TryToMakeActionAllowed(
|
bool TryToMakeActionAllowed(
|
||||||
CommandFlag & flags, CommandFlag flagsRqd, CommandFlag mask );
|
CommandFlag & flags, CommandFlag flagsRqd );
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1082,7 +1082,6 @@ bool ControlToolBar::DoRecord(AudacityProject &project,
|
|||||||
// NB: The call may have the side effect of changing flags.
|
// NB: The call may have the side effect of changing flags.
|
||||||
bool allowed = MenuManager::Get(project).TryToMakeActionAllowed(
|
bool allowed = MenuManager::Get(project).TryToMakeActionAllowed(
|
||||||
flags,
|
flags,
|
||||||
AudioIONotBusyFlag | CanStopAudioStreamFlag,
|
|
||||||
AudioIONotBusyFlag | CanStopAudioStreamFlag);
|
AudioIONotBusyFlag | CanStopAudioStreamFlag);
|
||||||
|
|
||||||
if (!allowed)
|
if (!allowed)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user