26 const RowConv conv { item.GetID() };
27 return conv.
value & 0x7FFFFFFF;
33 conv.
value = index | 0x80000000;
39 const wxString& filterType,
40 const wxString& filterExpr)
41 : mFilterType(filterType)
42 , mFilterExpr(filterExpr)
43 , mFilterState(filterState)
44 , mFilterCategory(filterEffectCategory)
47 for(
auto&
desc : pm.AllPlugins())
148 bool ascending)
const
160 const auto result = value1.GetString().CmpNoCase(value2.GetString());
163 return ascending == wxPtrToUInt(item1.GetID()) > wxPtrToUInt(item2.GetID()) ? 1 : -1;
164 return ascending ? result : -result;
167 return wxDataViewModel::Compare(item1, item2, column, ascending);
177 const auto enableCount = std::count_if(
180 [](
const auto& p) { return p.first->GetPluginType() == PluginTypeStub && p.second; }
190 if(!progressUpdateFn(++counter, enableCount,
desc->GetPath()))
195 if (mm.RegisterEffectPlugin(
desc->GetProviderID(),
desc->GetPath(), errMsg))
196 pm.UnregisterPlugin(
desc->GetProviderID() +
wxT(
"_") +
desc->GetPath());
199 errorFn(
XO(
"Effect or Command at %s failed to register:\n%s")
204 desc->SetEnabled(enabled);
207 pm.NotifyPluginsChanged();
244 variant = descriptor->GetSymbol().Translation();
250 wxFileName fname{ descriptor->GetPath() };
251 variant = fname.GetName().Trim(
false).Trim(
true);
255 variant = descriptor->GetPath();
258 variant = descriptor->GetEffectFamily();
300 children.push_back(wxDataViewItem(index));
302 return children.size();
322 [](wxString&
str) { str.MakeLower(); }
335 for(
auto& filter : textFilters)
338 desc->GetSymbol().
Translation().Lower().Find(filter) == wxNOT_FOUND) &&
340 wxFileName(
desc->GetPath()).GetName().Lower().Find(filter) == wxNOT_FOUND))
351 if(filterFn(
desc, state))
void * MakeRow(uint32_t index)
uint32_t GetRowIndex(const wxDataViewItem &item)
static ModuleManager & Get()
void SetFilterState(int state)
wxString GetColumnType(unsigned col) const override
std::vector< void * > mIndexFilterMap
int GetFilterCategory() const
wxDataViewItem GetParent(const wxDataViewItem &item) const override
wxDataViewItem GetItemForRow(uint32_t row) const
void SetFilterType(const wxString &type)
static const void * RowIdRoot
bool IsEnabled(const wxDataViewItem &, unsigned) const override
wxString GetFilterExpr() const
PluginDataModel(int filterEffectCategory=-1, int filterState=-1, const wxString &filterType={}, const wxString &filterExpr={})
bool GetRowForItem(const wxDataViewItem &item, uint32_t &row) const
int GetFilterState() const
PluginDescriptor * GetPlugin(wxDataViewItem item)
bool SetValue(const wxVariant &variant, const wxDataViewItem &item, unsigned col) override
wxString GetFilterType() const
bool HasContainerColumns(const wxDataViewItem &item) const override
unsigned GetChildren(const wxDataViewItem &item, wxDataViewItemArray &children) const override
void SetFilterExpr(const wxString &expr)
void ApplyChanges(const std::function< bool(int, int, const wxString &)> &progressUpdateFn, const std::function< void(const TranslatableString &)> &errorFn)
unsigned GetColumnCount() const override
uint32_t GetRowCount() const
bool IsFilterEmpty() const
void GetValue(wxVariant &variant, const wxDataViewItem &item, unsigned col) const override
void SetFilterCategory(int category)
bool IsContainer(const wxDataViewItem &item) const override
std::vector< std::pair< PluginDescriptor *, bool > > mPluginStateModel
int Compare(const wxDataViewItem &item1, const wxDataViewItem &item2, unsigned column, bool ascending) const override
static PluginManager & Get()
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
const TranslatableString desc