15#pragma GCC diagnostic ignored "-Wparentheses"
16#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
17#elif defined(__clang__)
18#pragma clang diagnostic ignored "-Wparentheses"
19#pragma clang diagnostic ignored "-Wdeprecated-declarations"
34#include <wx/evtloop.h>
38#include "../../widgets/AudacityMessageBox.h"
45#include <wx/msw/wrapwin.h>
157 if (!instanceFeatures.mOk)
160 nullptr, lilv_plugin_get_uri(&
mPlug)
168 LILV_FOREACH(nodes, i, extdata.get()) {
169 const auto node = lilv_nodes_get(extdata.get(), i);
170 const auto uri = lilv_node_as_string(node);
171 if (strcmp(uri, LV2_OPTIONS__interface) == 0)
173 else if (strcmp(uri, LV2_STATE__interface) == 0)
183 auto result = EffectSettings::Make<LV2EffectSettings>();
188 auto &value =
settings.values.emplace_back();
189 value = controlPort->mDef;
201 const auto portsCount = controlPorts.size();
208 assert(srcControls.size() == portsCount);
209 assert(dstControls.size() == portsCount);
211 const auto portValuesCount =
212 std::min(srcControls.size(), dstControls.size());
214 if (portValuesCount != portsCount)
219 for (
auto& port : controlPorts)
222 dstControls[portIndex] = srcControls[portIndex];
234 auto result = std::make_unique<LV2EffectOutputs>();
235 auto &
values = result->values;
254 static_cast<LV2Validator*
>(pValidator)->mDialog = &dialog;
258 dialog.SetMinSize(dialog.GetSize());
260 dialog.SetMaxSize(dialog.GetSize());
265 return dialog.ShowModal();
275 if (!parms.Write(port->mName,
values[index]))
287 if (port->mIsInput) {
289 if (!parms.Read(port->mName, &d))
292 if (d < port->mMin || d > port->mMax)
301 if (port->mIsInput) {
303 if (!parms.Read(port->mName, &d))
324 auto parent =
S.GetParent();
327 auto &myInstance =
dynamic_cast<LV2Instance &
>(instance);
346 auto result = std::make_unique<LV2Validator>(*
this,
mPlug,
352 const bool doX42Hack = vendor ==
"Robin Gareus";
353 result->mUI.mJustLeakMemory = doX42Hack;
357 result->mUseGUI = result->BuildFancy(move(pWrapper),
settings);
358 if (!result->mUseGUI && !result->BuildPlain(access))
368#ifdef __WX_EVTLOOP_BUSY_WAITING__
369 wxEventLoop::SetBusyWaiting(
false);
396 LILV_FOREACH(nodes, i, presets.get()) {
397 const auto preset = lilv_nodes_get(presets.get(), i);
404 node_Label,
nullptr) }) {
405 const auto label = lilv_nodes_get_first(labels.get());
432 lilv_state_new_from_world(
gWorld,
441 mySettings.mpState = move(state);
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
const TranslatableString name
std::optional< std::unique_ptr< EffectSettingsAccess::Message > > OptionalMessage
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
std::vector< RegistryPath > RegistryPaths
#define LV2EFFECTS_FAMILY
Lilv_ptr< LilvNodes, lilv_nodes_free > LilvNodesPtr
LV2EffectSettings & GetSettings(EffectSettings &settings)
wxString LilvString(const LilvNode *node)
std::unique_ptr< Type, Lilv_deleter< Type, f > > Lilv_ptr
Generate classes of smart pointers to lv2 resources.
wxString LilvStringMove(LilvNode *node)
Lilv_ptr< LilvNode, lilv_node_free > LilvNodePtr
EffectReverbSettings preset
static Settings & settings()
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the SettingsVis...
bool GetParameters(wxString &parms)
bool SetParameters(const wxString &parms)
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
const TranslatableString & Msgid() const
bool SupportsRealtime() const
RealtimeSince
In which versions of Audacity was an effect realtime capable?
Performs effect computation.
Hold values to send to effect output meters.
virtual const EffectSettings & Get()=0
Interface for transferring values from a panel of effect controls.
VendorSymbol GetVendor() const override
bool mFactoryPresetsLoaded
bool CopySettingsContents(const EffectSettings &src, EffectSettings &dst) const override
Update one settings object from another.
PluginPath GetPath() const override
int ShowClientInterface(wxWindow &parent, wxDialog &dialog, EffectUIValidator *pValidator, bool forceModal) override
RegistryPaths GetFactoryPresets() const override
Report names of factory presets.
bool SupportsAutomation() const override
Whether the effect has any automatable controls.
OptionalMessage LoadUserPreset(const RegistryPath &name, EffectSettings &settings) const override
RealtimeSince RealtimeSupport() const override
Since which version of Audacity has the effect supported realtime?
EffectFamilySymbol GetFamily() const override
Report identifier and user-visible name of the effect protocol.
void ExportPresets(const EffectSettings &settings) const override
void ShowOptions() override
bool HasOptions() override
bool SaveParameters(const RegistryPath &group, const EffectSettings &settings) const
RegistryPaths mFactoryPresetNames
EffectSettings MakeSettings() const override
bool mWantsStateInterface
bool SaveSettings(const EffectSettings &settings, CommandParameters &parms) const override
Store settings as keys and values.
LV2Effect(const LilvPlugin &plug)
std::unique_ptr< EffectOutputs > MakeOutputs() const override
Produce an object to hold values to send to effect output meters.
EffectType GetType() const override
Type determines how it behaves.
wxString GetVersion() const override
OptionalMessage LoadParameters(const RegistryPath &group, EffectSettings &settings) const
wxArrayString mFactoryPresetUris
bool mWantsOptionsInterface
ComponentInterfaceSymbol GetSymbol() const override
std::unique_ptr< EffectUIValidator > PopulateUI(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) override
Adds controls to a panel that is given as the parent window of S
bool LoadSettings(const CommandParameters &parms, EffectSettings &settings) const override
Restore settings from keys and values.
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
bool IsInteractive() const override
Whether the effect needs a dialog for entry of settings.
const LV2FeaturesList mFeatures
bool CanExportPresets() override
OptionalMessage LoadFactoryPreset(int id, EffectSettings &settings) const override
OptionalMessage ImportPresets(EffectSettings &settings) override
TranslatableString GetDescription() const override
bool SaveUserPreset(const RegistryPath &name, const EffectSettings &settings) const override
Save settings in the configuration file as a user-named preset.
bool IsDefault() const override
Whether the effect sorts "above the line" in the menus.
LV2_URID_Map * URIDMapFeature() const
static ComponentInterfaceSymbol GetPluginSymbol(const LilvPlugin &plug)
std::unique_ptr< LV2Wrapper > MakeWrapper(const EffectSettings &settings, double sampleRate, EffectOutputs *pOutputs)
void EmitPortValues(const LilvState &state, LV2EffectSettings &settings) const
LV2ControlPortArray mControlPorts
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.
wxString Translation() const
bool GetUseGUI(const EffectDefinitionInterface &effect, bool &useGUI)
bool SetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, const Value &value)
bool GetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var, const Value &defval)
std::string ToUTF8(const std::wstring &wstr)
Externalized state of a plug-in.
std::vector< float > values
vector of values in correspondence with the control ports