Audacity 3.2.0
Typedefs | Functions | Variables
anonymous_namespace{BatchProcessDialog.cpp} Namespace Reference

Typedefs

using MacroID = wxString
 

Functions

void OnApplyMacroDirectlyByName (const CommandContext &context, const MacroID &Name)
 
void OnRepeatLastTool (const CommandContext &context)
 
void OnManageMacros (const CommandContext &context)
 
void OnApplyMacrosPalette (const CommandContext &context)
 
void OnApplyMacroDirectly (const CommandContext &context)
 
void PopulateMacrosMenu (MenuRegistry::MenuItems &items, CommandFlag flags)
 
const ReservedCommandFlagHasLastToolFlag ()
 

Variables

AttachedWindows::RegisteredFactory sMacrosWindowKey
 

Typedef Documentation

◆ MacroID

using anonymous_namespace{BatchProcessDialog.cpp}::MacroID = typedef wxString

Definition at line 1399 of file BatchProcessDialog.cpp.

Function Documentation

◆ HasLastToolFlag()

const ReservedCommandFlag & anonymous_namespace{BatchProcessDialog.cpp}::HasLastToolFlag ( )

Definition at line 1517 of file BatchProcessDialog.cpp.

1517 { static ReservedCommandFlag flag{
1518 [](const AudacityProject &project) {
1519 auto& commandManager = CommandManager::Get(project);
1520 if (commandManager.mLastToolRegistration ==
1522 return true;
1523 return !commandManager.mLastTool.empty();
1524 }
1525 }; return flag;
1526}
const auto project
static std::once_flag flag
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static CommandManager & Get(AudacityProject &project)

References flag, CommandManager::Get(), project, and CommandManager::repeattypeunique.

Referenced by PluginMenuItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnApplyMacroDirectly()

void anonymous_namespace{BatchProcessDialog.cpp}::OnApplyMacroDirectly ( const CommandContext context)

Definition at line 1454 of file BatchProcessDialog.cpp.

1455{
1456 const MacroID& Name = context.parameter.GET();
1457 OnApplyMacroDirectlyByName(context, Name);
1458}
CommandParameter parameter
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
void OnApplyMacroDirectlyByName(const CommandContext &context, const MacroID &Name)

References Identifier::GET(), OnApplyMacroDirectlyByName(), and CommandContext::parameter.

Referenced by PopulateMacrosMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnApplyMacroDirectlyByName()

void anonymous_namespace{BatchProcessDialog.cpp}::OnApplyMacroDirectlyByName ( const CommandContext context,
const MacroID Name 
)

Definition at line 1460 of file BatchProcessDialog.cpp.

1462{
1463 auto &project = context.project;
1464 auto &window = GetProjectFrame(project);
1465 //wxLogDebug( "Macro was: %s", context.parameter);
1466 ApplyMacroDialog dlg( &window, project );
1467 //const auto &Name = context.parameter;
1468
1469// We used numbers previously, but macros could get renumbered, making
1470// macros containing macros unpredictable.
1471#ifdef MACROS_BY_NUMBERS
1472 long item=0;
1473 // Take last three letters (of e.g. Macro007) and convert to a number.
1474 Name.Mid( Name.length() - 3 ).ToLong( &item, 10 );
1475 dlg.ApplyMacroToProject( item, false );
1476#else
1477 dlg.ApplyMacroToProject( Name, false );
1478#endif
1479 /* i18n-hint: %s will be the name of the macro which will be
1480 * repeated if this menu item is chosen */
1482
1485 auto shortDesc = em.GetCommandName(Name);
1486 auto& undoManager = UndoManager::Get(project);
1487 auto& commandManager = CommandManager::Get(project);
1488 int cur = undoManager.GetCurrentState();
1489 if (undoManager.UndoAvailable()) {
1490 undoManager.GetShortDescription(cur, &desc);
1491 commandManager.Modify(wxT("RepeatLastTool"), XXO("&Repeat %s")
1492 .Format(desc));
1493 auto& commandManager = CommandManager::Get(project);
1494 commandManager.mLastTool = Name;
1495 commandManager.mLastToolRegistration =
1497 }
1498
1499}
wxT("CloseDown"))
XXO("&Cut/Copy/Paste Toolbar")
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Shows progress in executing commands in MacroCommands.
AudacityProject & project
EffectManager is the class that handles effects and effect categories.
Definition: EffectManager.h:48
static EffectManager & Get()
TranslatableString GetCommandName(const PluginID &ID)
Abstract base class used in importing a file.
Holds a msgid for the translation catalog; may also bind format arguments.
static UndoManager & Get(AudacityProject &project)
Definition: UndoManager.cpp:71
const TranslatableString desc
Definition: ExportPCM.cpp:51

References ApplyMacroDialog::ApplyMacroToProject(), anonymous_namespace{ExportPCM.cpp}::desc, EffectManager::Get(), CommandManager::Get(), UndoManager::Get(), EffectManager::GetCommandName(), GetProjectFrame(), CommandManager::ModifyUndoMenuItems(), CommandContext::project, project, CommandManager::repeattypeapplymacro, wxT(), and XXO().

Referenced by OnApplyMacroDirectly(), and OnRepeatLastTool().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnApplyMacrosPalette()

void anonymous_namespace{BatchProcessDialog.cpp}::OnApplyMacrosPalette ( const CommandContext context)

Definition at line 1441 of file BatchProcessDialog.cpp.

1442{
1443 auto &project = context.project;
1444 CommandManager::Get(project).RegisterLastTool(context); //Register Palette as Last Tool
1445 auto macrosWindow = &GetAttachedWindows(project)
1446 .AttachedWindows::Get< MacrosWindow >( sMacrosWindowKey );
1447 if (macrosWindow) {
1448 macrosWindow->Show();
1449 macrosWindow->Raise();
1450 macrosWindow->UpdateDisplay( false );
1451 }
1452}
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
void RegisterLastTool(const CommandContext &context)
void UpdateDisplay(bool bExpanded)
AttachedWindows::RegisteredFactory sMacrosWindowKey

References CommandManager::Get(), GetAttachedWindows(), CommandContext::project, project, CommandManager::RegisterLastTool(), sMacrosWindowKey, and MacrosWindow::UpdateDisplay().

Referenced by PluginMenuItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnManageMacros()

void anonymous_namespace{BatchProcessDialog.cpp}::OnManageMacros ( const CommandContext context)

Definition at line 1428 of file BatchProcessDialog.cpp.

1429{
1430 auto &project = context.project;
1431 CommandManager::Get(project).RegisterLastTool(context); //Register Macros as Last Tool
1432 auto macrosWindow = &GetAttachedWindows(project)
1433 .AttachedWindows::Get< MacrosWindow >( sMacrosWindowKey );
1434 if (macrosWindow) {
1435 macrosWindow->Show();
1436 macrosWindow->Raise();
1437 macrosWindow->UpdateDisplay( true );
1438 }
1439}

References CommandManager::Get(), GetAttachedWindows(), CommandContext::project, project, CommandManager::RegisterLastTool(), sMacrosWindowKey, and MacrosWindow::UpdateDisplay().

Referenced by PluginMenuItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnRepeatLastTool()

void anonymous_namespace{BatchProcessDialog.cpp}::OnRepeatLastTool ( const CommandContext context)

Definition at line 1404 of file BatchProcessDialog.cpp.

1405{
1406 auto& commandManager = CommandManager::Get(context.project);
1407 switch (commandManager.mLastToolRegistration) {
1409 {
1410 auto lastEffect = commandManager.mLastTool;
1411 if (!lastEffect.empty())
1412 {
1414 lastEffect, context, commandManager.mRepeatToolFlags);
1415 }
1416 }
1417 break;
1420 commandManager.mLastToolRegisteredId);
1421 break;
1423 OnApplyMacroDirectlyByName(context, commandManager.mLastTool);
1424 break;
1425 }
1426}
void DoRepeatProcess(const CommandContext &context, int)
AUDACITY_DLL_API bool DoEffect(const PluginID &ID, const CommandContext &context, unsigned flags)
'Repeat Last Effect'.
Definition: EffectUI.cpp:1148

References EffectUI::DoEffect(), CommandManager::DoRepeatProcess(), CommandManager::Get(), OnApplyMacroDirectlyByName(), CommandContext::project, CommandManager::repeattypeapplymacro, CommandManager::repeattypeplugin, and CommandManager::repeattypeunique.

Referenced by PluginMenuItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PopulateMacrosMenu()

void anonymous_namespace{BatchProcessDialog.cpp}::PopulateMacrosMenu ( MenuRegistry::MenuItems items,
CommandFlag  flags 
)

Definition at line 1501 of file BatchProcessDialog.cpp.

1502{
1503 using namespace MenuRegistry;
1504 auto names = MacroCommands::GetNames(); // these names come from filenames
1505 for (const auto &name : names) {
1508 Verbatim(name), // file name verbatim
1510 flags,
1512 ));
1513 }
1514}
const TranslatableString name
Definition: Distortion.cpp:76
static TranslatableStrings names
Definition: TagsEditor.cpp:153
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
static CommandID MacroIdOfName(const wxString &MacroName)
static wxArrayString GetNames()
constexpr auto Command
Definition: MenuRegistry.h:456
void OnApplyMacroDirectly(const CommandContext &context)
auto push_back(Arg &&arg) -> std::enable_if_t< Traits< Base, Derived > ::template enables_item_type_v< Arg >, void >
Definition: Composite.h:105
Options && AllowInMacros(int value=1) &&
Definition: MenuRegistry.h:69

References MenuRegistry::Options::AllowInMacros(), MenuRegistry::Command, MacroCommands::GetNames(), ApplyMacroDialog::MacroIdOfName(), name, names, OnApplyMacroDirectly(), Composite::Builder< Base, Derived, BaseArgs >::push_back(), and Verbatim().

Referenced by PluginMenuItems().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ sMacrosWindowKey

AttachedWindows::RegisteredFactory anonymous_namespace{BatchProcessDialog.cpp}::sMacrosWindowKey
Initial value:
{
[]( AudacityProject &parent ) -> wxWeakRef< wxWindow > {
auto &window = GetProjectFrame(parent);
&window, parent, true
);
}
}
#define safenew
Definition: MemoryX.h:10

Definition at line 1390 of file BatchProcessDialog.cpp.

Referenced by OnApplyMacrosPalette(), and OnManageMacros().