MCPcopy Create free account
hub / github.com/audacity/audacity / GetAudacityCommand

Method GetAudacityCommand

src/EffectAndCommandPluginManager.cpp:44–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44AudacityCommand*
45EffectAndCommandPluginManager::GetAudacityCommand(const PluginID& ID)
46{
47 // Must have a "valid" ID
48 if (ID.empty())
49 {
50 return NULL;
51 }
52
53 if (mCommands.find(ID) == mCommands.end())
54 {
55 // This will instantiate the command if it hasn't already been done
56 auto command =
57 dynamic_cast<AudacityCommand*>(PluginManager::Get().Load(ID));
58 if (command)
59 {
60 command->Init();
61 mCommands[ID] = command;
62 return command;
63 }
64
65 BasicUI::ShowMessageBox(
66 XO("Attempting to initialize the following command failed:\n\n%s\n\nMore information may be available in 'Help > Diagnostics > Show Log'")
67 .Format(PluginManager::Get().GetName(ID)),
68 BasicUI::MessageBoxOptions {}.Caption(
69 XO("Command failed to initialize")));
70
71 return NULL;
72 }
73
74 return mCommands[ID];
75}
76
77ManualPageID EffectAndCommandPluginManager::GetCommandUrl(const PluginID& ID)
78{

Callers

nothing calls this directly

Calls 8

GetFunction · 0.85
ShowMessageBoxFunction · 0.85
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
LoadMethod · 0.45
InitMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected