27#include <wx/statbox.h>
28#include <wx/scrolwin.h>
37#if wxUSE_ACCESSIBILITY
63 return wxID_HIGHEST + index * 3;
68 return (
id - wxID_HIGHEST) / 3;
73 template<
typename... Args>
82 auto mainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
83 mainSizer->Add(
mRows =
safenew wxBoxSizer(wxVERTICAL), 0, wxEXPAND);
88 SetSizer(mainSizer.release());
97 auto rowSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
102 text =
safenew wxTextCtrl(
this, baseId, path),
103 1, wxEXPAND | wxALL, 3
106 browse =
safenew wxButton(
this, baseId + 1,
_(
"Browse...")),
110 remove =
safenew wxButton(
this, baseId + 2,
_(
"Remove")),
113 text->Bind(wxEVT_TEXT, [
this](wxCommandEvent& evt)
116 mPaths[index] = evt.GetString();
125 mRows->Add(rowSizer.release(), 0, wxEXPAND);
132 wxPostEvent(
this, wxCommandEvent(EVT_PLUGIN_LOCATIONS_CHANGED));
137 for(
const auto& location : paths)
144 for(
const auto& text :
mPaths)
147 paths.push_back(text);
168 [](
const auto ptr) { return ptr != nullptr; }
172 FindWindowById(baseId,
this)->Destroy();
173 FindWindowById(baseId + 1,
this)->Destroy();
174 FindWindowById(baseId + 2,
this)->Destroy();
176 mPaths[index] = wxString{};
178 wxPostEvent(
this, wxCommandEvent(EVT_PLUGIN_LOCATIONS_CHANGED));
186 wxGetTopLevelParent(
this),
190 if(dirDialog.ShowModal() == wxID_OK)
191 mPathCtrls[index]->SetValue(dirDialog.GetPath());
213 return XO(
"Preferences for Effects");
218 return "Effects_Preferences";
235 XO(
"Sort by effect name") ,
236 XO(
"Sort by publisher and effect name") ,
237 XO(
"Sort by type and effect name") ,
238 XO(
"Group by publisher") ,
239 XO(
"Group by type") ,
240 XO(
"Group by category"),
241 XO(
"Group by type and publisher")
245 wxT(
"sortby:publisher:name") ,
246 wxT(
"sortby:type:name") ,
247 wxT(
"groupby:publisher") ,
248 wxT(
"groupby:type") ,
250 wxT(
"groupby:type:publisher")
255 wxT(
"/Effects/SkipEffectsScanAtStartup"),
260 wxT(
"/Effects/GroupBy"),
266 wxT(
"/Effects/RealtimeGroupBy"),
273 const auto scroller =
S.StartScroller();
275 S.StartStatic(
XO(
"Effect Options"));
277 S.StartMultiColumn(2);
289#ifdef EXPERIMENTAL_EQ_SSE_THREADED
290 S.StartStatic(
XO(
"Instruction Set"));
292 S.TieCheckBox(
XXO(
"&Use SSE/SSE2/.../AVX"),
302 if(!provider->SupportsCustomModulePaths())
308 const auto panelTitle =
XO(
"%s plugin locations")
309 .Format(provider->GetOptionalFamilySymbol().Translation());
310 S.StartStatic(panelTitle);
315#if wxUSE_ACCESSIBILITY
316 panel->SetName(panelTitle);
320 panel->AddLocations(pluginManager.ReadCustomPaths(*provider.get()));
321 S.Prop(1).AddWindow(panel, wxEXPAND);
322 mLocations.emplace_back(provider.get(), panel);
324 panel->Bind(EVT_PLUGIN_LOCATIONS_CHANGED, [wnd = wxWeakRef(scroller)](
const auto&)
338 if (
auto pButton =
S.AddButton(
XXO(
"Open Plugin &Manager"), wxALIGN_LEFT))
339 pButton->Bind(wxEVT_BUTTON, [
this](
auto) {
343 if(dialog.ShowModal() == wxID_OK)
355 pluginManager.StoreCustomPaths(*provider, panel->GetLocations());
EnumValueSymbols EffectsGroupSymbols
wxDEFINE_EVENT(EVT_PLUGIN_LOCATIONS_CHANGED, wxCommandEvent)
ChoiceSetting EffectsGroupBy
BoolSetting SkipEffectsScanAtStartup
ChoiceSetting RealtimeEffectsGroupBy
#define EFFECTS_PREFS_PLUGIN_SYMBOL
XXO("&Cut/Copy/Paste Toolbar")
std::vector< PluginPath > PluginPaths
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
This specialization of Setting for bool adds a Toggle method to negate the saved value.
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
std::vector< wxString > mPaths
void OnRemoveClicked(wxCommandEvent &evt)
EffectsLocationPanel(Args &&... args)
void OnAddNewLocationClicked(wxCommandEvent &)
std::vector< wxTextCtrl * > mPathCtrls
void AddLocations(const PluginPaths &paths)
PluginPaths GetLocations() const
static int IndexForId(int id)
void AddLocation(const PluginPath &path, bool setFocus=false)
wxButton * mAddNewLocation
static int BaseRowIdForIndex(int index)
void OnBrowseClicked(wxCommandEvent &evt)
A PrefsPanel for general GUI preferences.
void PopulateOrExchange(ShuttleGui &S) override
EffectsPrefs(wxWindow *parent, wxWindowID winid)
ComponentInterfaceSymbol GetSymbol() const override
TranslatableString GetDescription() const override
ManualPageID HelpPageName() override
If not empty string, the Help button is added below the panel.
std::vector< std::pair< PluginProvider *, EffectsLocationPanel * > > mLocations
static ModuleManager & Get()
static PluginManager & Get()
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Holds a msgid for the translation catalog; may also bind format arguments.
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
static const TranslatableString DefaultDialogPrompt
PrefsPanel::Registration sAttachment