| 228 | } |
| 229 | |
| 230 | void 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 | |
| 268 | bool PluginDataModel::SetValue(const wxVariant& variant, const wxDataViewItem& item, unsigned col) |
| 269 | { |
nothing calls this directly
no test coverage detected