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

Method GetValue

src/PluginDataModel.cpp:230–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void PluginDataModel::GetValue(wxVariant& variant, const wxDataViewItem& item, unsigned col) const
231{
232 assert(item.IsOk());
233
234 const auto index = GetRowIndex(item);
235 if(index >= mPluginStateModel.size())
236 return;
237
238 const auto [descriptor, state] = mPluginStateModel[index];
239 switch(col)
240 {
241 case ColumnName:
242 {
243 if (descriptor->GetPluginType() == PluginTypeEffect)
244 variant = descriptor->GetSymbol().Translation();
245 // This is not right and will not work when other plugin types are added.
246 // But it's presumed that the plugin manager dialog will be fully developed
247 // by then.
248 else if (descriptor->GetPluginType() == PluginTypeStub)
249 {
250 wxFileName fname{ descriptor->GetPath() };
251 variant = fname.GetName().Trim(false).Trim(true);
252 }
253 } break;
254 case ColumnPath:
255 variant = descriptor->GetPath();
256 break;
257 case ColumnType:
258 variant = descriptor->GetEffectFamily();
259 break;
260 case ColumnState:
261 variant = state;
262 break;
263 default:
264 break;
265 }
266}
267
268bool PluginDataModel::SetValue(const wxVariant& variant, const wxDataViewItem& item, unsigned col)
269{

Callers

nothing calls this directly

Calls 10

GetRowIndexFunction · 0.85
GetPluginTypeMethod · 0.80
TranslationMethod · 0.80
GetEffectFamilyMethod · 0.80
IsOkMethod · 0.45
sizeMethod · 0.45
GetSymbolMethod · 0.45
GetPathMethod · 0.45
TrimMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected