mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-28 14:18:41 +02:00
Some command flags can be defined nearer their sole points of use
This commit is contained in:
parent
9d800c8969
commit
5fda4b959f
@ -237,36 +237,6 @@ const ReservedCommandFlag&
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
}; return flag; }
|
}; return flag; }
|
||||||
const ReservedCommandFlag&
|
|
||||||
HasLastGeneratorFlag() { static ReservedCommandFlag flag{
|
|
||||||
[](const AudacityProject &project){
|
|
||||||
return !MenuManager::Get( project ).mLastGenerator.empty();
|
|
||||||
}
|
|
||||||
}; return flag; }
|
|
||||||
const ReservedCommandFlag&
|
|
||||||
HasLastEffectFlag() { static ReservedCommandFlag flag{
|
|
||||||
[](const AudacityProject &project) {
|
|
||||||
return !MenuManager::Get(project).mLastEffect.empty();
|
|
||||||
}
|
|
||||||
}; return flag;
|
|
||||||
}
|
|
||||||
const ReservedCommandFlag&
|
|
||||||
HasLastAnalyzerFlag() { static ReservedCommandFlag flag{
|
|
||||||
[](const AudacityProject &project) {
|
|
||||||
if (MenuManager::Get(project).mLastAnalyzerRegistration == MenuCreator::repeattypeunique) return true;
|
|
||||||
return !MenuManager::Get(project).mLastAnalyzer.empty();
|
|
||||||
}
|
|
||||||
}; return flag;
|
|
||||||
}
|
|
||||||
const ReservedCommandFlag&
|
|
||||||
HasLastToolFlag() { static ReservedCommandFlag flag{
|
|
||||||
[](const AudacityProject &project) {
|
|
||||||
auto& menuManager = MenuManager::Get(project);
|
|
||||||
if (menuManager.mLastToolRegistration == MenuCreator::repeattypeunique) return true;
|
|
||||||
return !menuManager.mLastTool.empty();
|
|
||||||
}
|
|
||||||
}; return flag;
|
|
||||||
}
|
|
||||||
const ReservedCommandFlag&
|
const ReservedCommandFlag&
|
||||||
UndoAvailableFlag() { static ReservedCommandFlag flag{
|
UndoAvailableFlag() { static ReservedCommandFlag flag{
|
||||||
[](const AudacityProject &project){
|
[](const AudacityProject &project){
|
||||||
|
@ -38,10 +38,6 @@ extern AUDACITY_DLL_API const ReservedCommandFlag
|
|||||||
extern AUDACITY_DLL_API const ReservedCommandFlag
|
extern AUDACITY_DLL_API const ReservedCommandFlag
|
||||||
&LabelTracksExistFlag(),
|
&LabelTracksExistFlag(),
|
||||||
&UnsavedChangesFlag(),
|
&UnsavedChangesFlag(),
|
||||||
&HasLastGeneratorFlag(),
|
|
||||||
&HasLastEffectFlag(),
|
|
||||||
&HasLastAnalyzerFlag(),
|
|
||||||
&HasLastToolFlag(),
|
|
||||||
&UndoAvailableFlag(),
|
&UndoAvailableFlag(),
|
||||||
&RedoAvailableFlag(),
|
&RedoAvailableFlag(),
|
||||||
&ZoomInAvailableFlag(),
|
&ZoomInAvailableFlag(),
|
||||||
|
@ -811,6 +811,14 @@ MenuTable::BaseItemPtrs PopulateMacrosMenu( CommandFlag flags )
|
|||||||
// Under /MenuBar
|
// Under /MenuBar
|
||||||
namespace {
|
namespace {
|
||||||
using namespace MenuTable;
|
using namespace MenuTable;
|
||||||
|
|
||||||
|
const ReservedCommandFlag&
|
||||||
|
HasLastGeneratorFlag() { static ReservedCommandFlag flag{
|
||||||
|
[](const AudacityProject &project){
|
||||||
|
return !MenuManager::Get( project ).mLastGenerator.empty();
|
||||||
|
}
|
||||||
|
}; return flag; }
|
||||||
|
|
||||||
BaseItemSharedPtr GenerateMenu()
|
BaseItemSharedPtr GenerateMenu()
|
||||||
{
|
{
|
||||||
// All of this is a bit hacky until we can get more things connected into
|
// All of this is a bit hacky until we can get more things connected into
|
||||||
@ -873,6 +881,14 @@ AttachedItem sAttachment1{
|
|||||||
Shared( GenerateMenu() )
|
Shared( GenerateMenu() )
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const ReservedCommandFlag&
|
||||||
|
HasLastEffectFlag() { static ReservedCommandFlag flag{
|
||||||
|
[](const AudacityProject &project) {
|
||||||
|
return !MenuManager::Get(project).mLastEffect.empty();
|
||||||
|
}
|
||||||
|
}; return flag;
|
||||||
|
}
|
||||||
|
|
||||||
BaseItemSharedPtr EffectMenu()
|
BaseItemSharedPtr EffectMenu()
|
||||||
{
|
{
|
||||||
// All of this is a bit hacky until we can get more things connected into
|
// All of this is a bit hacky until we can get more things connected into
|
||||||
@ -926,6 +942,15 @@ AttachedItem sAttachment2{
|
|||||||
Shared( EffectMenu() )
|
Shared( EffectMenu() )
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const ReservedCommandFlag&
|
||||||
|
HasLastAnalyzerFlag() { static ReservedCommandFlag flag{
|
||||||
|
[](const AudacityProject &project) {
|
||||||
|
if (MenuManager::Get(project).mLastAnalyzerRegistration == MenuCreator::repeattypeunique) return true;
|
||||||
|
return !MenuManager::Get(project).mLastAnalyzer.empty();
|
||||||
|
}
|
||||||
|
}; return flag;
|
||||||
|
}
|
||||||
|
|
||||||
BaseItemSharedPtr AnalyzeMenu()
|
BaseItemSharedPtr AnalyzeMenu()
|
||||||
{
|
{
|
||||||
// All of this is a bit hacky until we can get more things connected into
|
// All of this is a bit hacky until we can get more things connected into
|
||||||
@ -983,6 +1008,16 @@ AttachedItem sAttachment3{
|
|||||||
Shared( AnalyzeMenu() )
|
Shared( AnalyzeMenu() )
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const ReservedCommandFlag&
|
||||||
|
HasLastToolFlag() { static ReservedCommandFlag flag{
|
||||||
|
[](const AudacityProject &project) {
|
||||||
|
auto& menuManager = MenuManager::Get(project);
|
||||||
|
if (menuManager.mLastToolRegistration == MenuCreator::repeattypeunique) return true;
|
||||||
|
return !menuManager.mLastTool.empty();
|
||||||
|
}
|
||||||
|
}; return flag;
|
||||||
|
}
|
||||||
|
|
||||||
BaseItemSharedPtr ToolsMenu()
|
BaseItemSharedPtr ToolsMenu()
|
||||||
{
|
{
|
||||||
using Options = CommandManager::Options;
|
using Options = CommandManager::Options;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user