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

Method GetName

src/PluginDataViewCtrl.cpp:227–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225 }
226
227 wxAccStatus GetName(int childId, wxString* name) override
228 {
229 const auto ctrl = GetCtrl();
230 wxCHECK(ctrl, wxACC_FAIL);
231
232 name->clear();
233
234 if(childId == wxACC_SELF)
235 {
236 *name = ctrl->GetName();
237 return wxACC_OK;
238 }
239
240 const auto model = GetModel();
241 if(model == nullptr)
242 return wxACC_INVALID_ARG;
243
244 const auto item = ctrl->GetItemByRow(childId - 1);
245 if(!item.IsOk())
246 return wxACC_INVALID_ARG;
247
248 const auto plugin = model->GetPlugin(item);
249 if(plugin == nullptr)
250 return wxACC_INVALID_ARG;
251
252 wxVariant state;
253 model->GetValue(state, item, PluginDataModel::ColumnState);
254
255 //separate type and path parts with comma so that
256 //screen reader would make a short pause between them
257 *name = wxString::Format("%s %s %s, %s",
258 plugin->GetPluginType() == PluginTypeEffect
259 ? plugin->GetSymbol().Translation()
260 : wxFileName(plugin->GetPath()).GetName(),
261 state.GetBool()
262 ? _("Enabled")
263 : _("Disabled"),
264 plugin->GetEffectFamily(),
265 plugin->GetPath());
266
267 return wxACC_OK;
268 }
269
270 wxAccStatus GetFocus(int* childId, wxAccessible** accessible) override
271 {

Callers

nothing calls this directly

Calls 11

GetPluginTypeMethod · 0.80
TranslationMethod · 0.80
GetBoolMethod · 0.80
GetEffectFamilyMethod · 0.80
wxFileNameClass · 0.70
clearMethod · 0.45
IsOkMethod · 0.45
GetPluginMethod · 0.45
GetValueMethod · 0.45
GetSymbolMethod · 0.45
GetPathMethod · 0.45

Tested by

no test coverage detected