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

Method SetCommandAndParams

src/BatchCommandDialog.cpp:235–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void MacroCommandDialog::SetCommandAndParams(const CommandID &Command, const wxString &Params)
236{
237 auto iter = mCatalog.ByCommandId( Command );
238
239 mParameters->SetValue( Params );
240
241 mInternalCommandName = Command;
242 if (iter == mCatalog.end())
243 // uh oh, using GET to expose an internal name to the user!
244 // in default of any better friendly name
245 mCommand->SetValue( Command.GET() );
246 else {
247 mCommand->SetValue( iter->name.StrippedTranslation() );
248 // using GET to expose a CommandID to the user!
249 // Macro command details are one place that we do expose Identifier
250 // to (more sophisticated) users
251 mDetails->SetValue(
252 iter->name.Internal() + "\r\n" + iter->category.Translation() );
253 mChoices->SetItemState(iter - mCatalog.begin(),
254 wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
255
256 PluginID ID = PluginManager::Get().GetByCommandIdentifier(Command);
257
258 // If ID is empty, then the effect wasn't found, in which case, the user must have
259 // selected one of the "special" commands.
260 mEditParams->Enable(!ID.empty());
261 mUsePreset->Enable(EffectManager::Get().HasPresets(ID));
262 }
263}

Callers

nothing calls this directly

Calls 10

GetFunction · 0.85
ByCommandIdMethod · 0.80
StrippedTranslationMethod · 0.80
TranslationMethod · 0.80
HasPresetsMethod · 0.80
SetValueMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
EnableMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected