33#if !defined(__WXMSW__)
37#define RTLD_DEEPBIND 0
44#include <wx/checkbox.h>
45#include <wx/dcclient.h>
46#include <wx/filename.h>
51#include <wx/statbox.h>
52#include <wx/stattext.h>
53#include <wx/textctrl.h>
54#include <wx/tokenzr.h>
56#include <wx/scrolwin.h>
57#include <wx/version.h>
61#include "../../ShuttleGui.h"
62#include "../../widgets/NumericTextCtrl.h"
63#include "../../widgets/valnum.h"
64#include "../../widgets/wxPanelWrapper.h"
67#if wxUSE_ACCESSIBILITY
68#include "../../widgets/WindowAccessible.h"
118 auto result = EffectSettings::Make<LadspaEffectSettings>(
mData->
PortCount );
131 dstControls.resize(0);
132 copy(srcControls.begin(), srcControls.end(), back_inserter(dstControls));
150 return XO(
"LADSPA Effects");
155 return XO(
"The Audacity Team");
166 return XO(
"Provides LADSPA Effects");
235 for (
size_t j = 0, cnt = files.size(); j < cnt; j++)
252#if defined(__WXMAC__)
257#elif defined(__WXMSW__)
269 return { files.begin(), files.end() };
280 if (ff.GetName().CmpNoCase(wxT(
"vst-bridge")) == 0) {
281 errMsg =
XO(
"Audacity no longer uses vst-bridge");
289 bool hadpath = wxGetEnv(wxT(
"PATH"), &envpath);
290 wxSetEnv(wxT(
"PATH"), ff.GetPath() + wxFILE_SEP_PATH + envpath);
291 wxString saveOldCWD = ff.GetCwd();
298#if defined(__WXMSW__)
299 wxDynamicLibrary lib;
300 if (lib.Load(path, wxDL_NOW))
302 void *lib = dlopen((
const char *)path.ToUTF8(), RTLD_NOW | RTLD_LOCAL | RTLD_DEEPBIND);
307#if defined(__WXMSW__)
318 for (data = mainFn(index); data; data = mainFn(++index)) {
323 callback(
this, &effect );
326 errMsg =
XO(
"Could not load the library");
331 errMsg =
XO(
"Could not load the library");
333#if defined(__WXMSW__)
334 if (lib.IsLoaded()) {
339 using namespace std::chrono;
340 std::this_thread::sleep_for(10ms);
349 wxSetWorkingDirectory(saveOldCWD);
350 hadpath ? wxSetEnv(wxT(
"PATH"), envpath) : wxUnsetEnv(wxT(
"PATH"));
359 wxString realPath = path.BeforeFirst(wxT(
';'));
360 return wxFileName::FileExists(realPath);
363std::unique_ptr<ComponentInterface>
371 wxString realPath = path.BeforeFirst(wxT(
';'));
372 path.AfterFirst(wxT(
';')).ToLong(&index);
373 auto result = std::make_unique<LadspaEffect>(realPath, (
int)index);
374 result->FullyInitializePlugin();
384 pathVar = wxString::FromUTF8(getenv(
"LADSPA_PATH"));
385 if (!pathVar.empty())
387 wxStringTokenizer tok(pathVar, wxPATH_SEP);
388 while (tok.HasMoreTokens())
390 pathList.push_back(tok.GetNextToken());
394#if defined(__WXMAC__)
395#define LADSPAPATH wxT("/Library/Audio/Plug-Ins/LADSPA")
398 pathList.push_back(wxGetHomeDir() + wxFILE_SEP_PATH +
LADSPAPATH);
401#elif defined(__WXMSW__)
407 pathList.push_back(wxGetHomeDir() + wxFILE_SEP_PATH + wxT(
".ladspa"));
409 pathList.push_back(wxT(
"/usr/local/lib64/ladspa"));
410 pathList.push_back(wxT(
"/usr/lib64/ladspa"));
412 pathList.push_back(wxT(
"/usr/local/lib/ladspa"));
413 pathList.push_back(wxT(
"/usr/lib/ladspa"));
414 pathList.push_back(wxT(LIBDIR) wxT(
"/ladspa"));
436 void OnOk(wxCommandEvent & evt);
442 DECLARE_EVENT_TABLE()
458 PopulateOrExchange(
S);
486 S.StartHorizontalLay(wxEXPAND, 1);
488 S.StartVerticalLay(
false);
490 S.StartStatic(
XO(
"Latency Compensation"));
492 S.AddVariableText(
XO(
493"As part of their processing, some LADSPA effects must delay returning "
494"audio to Audacity. When not compensating for this delay, you will "
495"notice that small silences have been inserted into the audio. "
496"Enabling this option will provide that compensation, but it may "
497"not work for all LADSPA effects."),
500 S.StartHorizontalLay(wxALIGN_LEFT);
502 S.TieCheckBox(
XXO(
"Enable &compensation"),
505 S.EndHorizontalLay();
511 S.EndHorizontalLay();
513 S.AddStandardButtons();
558 void OnErase(wxEraseEvent & evt);
559 void OnPaint(wxPaintEvent & evt);
560 void OnIdle(wxIdleEvent & evt);
561 void OnSize(wxSizeEvent & evt);
569 DECLARE_EVENT_TABLE()
580: wxWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDEFAULT_CONTROL_BORDER),
586 SetBackgroundColour(*wxWHITE);
610 wxRect r = GetClientRect();
611 wxCoord x = r.GetLeft();
612 wxCoord y = r.GetTop();
613 wxCoord w = r.GetWidth();
614 wxCoord h = r.GetHeight();
625 dc.SetPen(*wxTRANSPARENT_PEN);
626 dc.SetBrush(wxColour(100, 100, 220));
628 dc.DrawRectangle(x, y, (w * (val / fabs(
mMax -
mMin))), h);
660 return wxString::Format(wxT(
"%s;%d"),
mPath,
mIndex);
733std::pair<float, float>
737 const auto multiplier =
757 const auto combine = [bounds,
759 ](
float lowWeight,
float highWeight){
760 auto [lower, upper] = bounds;
762 ? exp(log(lower) * lowWeight + log(upper) * highWeight)
763 : lower * lowWeight + upper * highWeight;
766 auto [lower, upper] = bounds;
776 val = combine(0.75, 0.25);
break;
778 val = combine(0.5, 0.5);
break;
780 val = combine(0.25, 0.75);
break;
874 const float *
const *inBlock,
float *
const *outBlock,
size_t blockLen)
889 const float *
const *inBuf,
float *
const *outBuf,
size_t numSamples)
907 return std::make_shared<Instance>(*
this);
935 if (effect.mUseLatency && effect.mLatencyPort >= 0 && !
mLatencyDone) {
937 return sampleCount{ controls[effect.mLatencyPort] };
947 auto &effect = GetEffect();
949 mMaster = effect.InitInstance(sampleRate, ladspaSettings);
954 mLatencyDone =
false;
962 GetEffect().FreeInstance(mMaster);
970 const float *
const *inBlock,
float *
const *outBlock,
size_t blockLen)
972 auto &effect = GetEffect();
973 for (
unsigned i = 0; i < effect.mAudioIns; ++i)
974 effect.mData->connect_port(mMaster, effect.mInputPorts[i],
975 const_cast<float*
>(inBlock[i]));
977 for (
unsigned i = 0; i < effect.mAudioOuts; ++i)
978 effect.mData->connect_port(mMaster, effect.mOutputPorts[i], outBlock[i]);
980 effect.mData->run(mMaster, blockLen);
992 auto &effect = GetEffect();
994 LADSPA_Handle slave = effect.InitInstance(sampleRate, ladspaSettings);
1000 mSlaves.push_back(slave);
1007return GuardedCall<bool>([&]{
1008 auto &effect = GetEffect();
1009 for (
size_t i = 0, cnt = mSlaves.size(); i < cnt; ++i)
1010 effect.FreeInstance(mSlaves[i]);
1033 const float *
const *inbuf,
float *
const *outbuf,
size_t numSamples)
1035 if (group >= mSlaves.size())
1038 auto &effect = GetEffect();
1039 for (
unsigned i = 0; i < effect.mAudioIns; ++i)
1040 effect.mData->connect_port(mSlaves[group], effect.mInputPorts[i],
1041 const_cast<float*
>(inbuf[i]));
1043 for (
unsigned i = 0; i < effect.mAudioOuts; ++i)
1044 effect.mData->connect_port(
1045 mSlaves[group], effect.mOutputPorts[i], outbuf[i]);
1047 effect.mData->run(mSlaves[group], numSamples);
1058 wxWindow &parent, wxDialog &dialog,
bool forceModal)
1062 dialog.SetMinSize(dialog.GetSize());
1070 return dialog.ShowModal();
1097 if (!parms.Read(labelText, &d))
1147 void OnSlider(wxCommandEvent & evt);
1176 auto &effect = GetEffect();
1177 auto &controls = mSettings.controls;
1178 auto parent =
S.GetParent();
1182 const auto &data = *effect.mData;
1183 mToggles.reinit( data.PortCount );
1184 mSliders.reinit( data.PortCount );
1185 mFields.reinit( data.PortCount,
true);
1186 mLabels.reinit( data.PortCount );
1187 mMeters.reinit( data.PortCount );
1190 wxScrolledWindow *
const w =
safenew wxScrolledWindow(mParent,
1194 wxVSCROLL | wxTAB_TRAVERSAL);
1197 auto mainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
1198 w->SetScrollRate(0, 20);
1201 w->SetName(wxT(
"\a"));
1202 w->SetLabel(wxT(
"\a"));
1204 mainSizer->Add(w, 1, wxEXPAND);
1205 mParent->SetSizer(mainSizer.release());
1208 wxSizer *marginSizer;
1210 auto uMarginSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
1211 marginSizer = uMarginSizer.get();
1214 if (effect.mNumInputControls) {
1215 auto paramSizer = std::make_unique<wxStaticBoxSizer>(wxVERTICAL, w,
_(
"Effect Settings"));
1217 auto gridSizer = std::make_unique<wxFlexGridSizer>(5, 0, 0);
1218 gridSizer->AddGrowableCol(3);
1224 item =
safenew wxStaticText(w, 0,
_(
"Duration:"));
1225 gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
1226 auto &extra = mAccess.Get().extra;
1230 extra.GetDurationFormat(),
1231 extra.GetDuration(),
1235 mDuration->SetName(
XO(
"Duration") );
1236 gridSizer->Add(mDuration, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
1237 gridSizer->Add(1, 1, 0);
1238 gridSizer->Add(1, 1, 0);
1239 gridSizer->Add(1, 1, 0);
1242 for (
unsigned long p = 0; p < data.PortCount; ++p) {
1249 wxString labelText =
LAT1CTOWX(data.PortNames[p]);
1250 item =
safenew wxStaticText(w, 0, wxString::Format(
_(
"%s:"), labelText));
1251 gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
1258 mToggles[p]->SetName(labelText);
1259 mToggles[p]->SetValue(controls[p] > 0);
1260 BindTo(*mToggles[p],
1262 gridSizer->Add(mToggles[p], 0, wxALL, 5);
1264 gridSizer->Add(1, 1, 0);
1265 gridSizer->Add(1, 1, 0);
1266 gridSizer->Add(1, 1, 0);
1271 float lower = -FLT_MAX;
1272 float upper = FLT_MAX;
1275 bool forceint =
false;
1288 lower *= mSampleRate;
1289 upper *= mSampleRate;
1294 lower = ceilf(lower * 1000000.0) / 1000000.0;
1295 upper = floorf(upper * 1000000.0) / 1000000.0;
1296 controls[p] = roundf(controls[p] * 1000000.0) / 1000000.0;
1298 if (haslo && controls[p] < lower)
1299 controls[p] = lower;
1301 if (hashi && controls[p] > upper)
1302 controls[p] = upper;
1308 mFields[p]->SetName(labelText);
1311 gridSizer->Add(mFields[p], 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
1317 str.Printf(wxT(
"%d"), (
int)(lower + 0.5));
1324 gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
1327 gridSizer->Add(1, 1, 0);
1333#if wxUSE_ACCESSIBILITY
1337 mSliders[p]->SetName(labelText);
1338 BindTo(*mSliders[p],
1340 gridSizer->Add(mSliders[p], 0, wxALIGN_CENTER_VERTICAL | wxEXPAND | wxALL, 5);
1344 str.Printf(wxT(
"%d"), (
int)(upper + 0.5));
1348 gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 5);
1351 gridSizer->Add(1, 1, 0);
1354 fieldText.Printf(wxT(
"%d"), (
int)(controls[p] + 0.5));
1356 IntegerValidator<float> vld(&controls[p]);
1357 vld.SetRange(haslo ? lower : INT_MIN,
1358 hashi ? upper : INT_MAX);
1359 mFields[p]->SetValidator(vld);
1365 FloatingPointValidator<float> vld(6, &controls[p]);
1366 vld.SetRange(lower, upper);
1369 if (upper - lower < 10.0)
1370 vld.SetStyle(NumValidatorStyle::THREE_TRAILING_ZEROES);
1371 else if (upper - lower < 100.0)
1372 vld.SetStyle(NumValidatorStyle::TWO_TRAILING_ZEROES);
1374 vld.SetStyle(NumValidatorStyle::ONE_TRAILING_ZERO);
1376 mFields[p]->SetValidator(vld);
1381 mFields[p]->SetValue(fieldText);
1384 paramSizer->Add(gridSizer.release(), 0, wxEXPAND | wxALL, 5);
1385 marginSizer->Add(paramSizer.release(), 0, wxEXPAND | wxALL, 5);
1389 if (effect.mNumOutputControls > 0) {
1390 auto paramSizer = std::make_unique<wxStaticBoxSizer>(wxVERTICAL, w,
_(
"Effect Output"));
1392 auto gridSizer = std::make_unique<wxFlexGridSizer>(2, 0, 0);
1393 gridSizer->AddGrowableCol(1);
1397 for (
unsigned long p = 0; p < data.PortCount; ++p) {
1402 wxString labelText =
LAT1CTOWX(data.PortNames[p]);
1404 w, 0, wxString::Format(
_(
"%s:"), labelText));
1406 item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
1415 lower = ceilf(lower * 1000000.0) / 1000000.0;
1416 upper = floorf(upper * 1000000.0) / 1000000.0;
1417 controls[p] = lower;
1422 w, controls[p], lower, upper);
1423 mMeters[p]->SetLabel(labelText);
1424 gridSizer->Add(mMeters[p], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 5);
1427 paramSizer->Add(gridSizer.release(), 0, wxEXPAND | wxALL, 5);
1428 marginSizer->Add(paramSizer.release(), 0, wxEXPAND | wxALL, 5);
1431 w->SetSizer(uMarginSizer.release());
1437 wxSize sz1 = marginSizer->GetMinSize();
1438 wxSize sz2 = mParent->GetMinSize();
1442 mParent->SetMinSize({ -1, -1 });
1445std::unique_ptr<EffectUIValidator>
1451 result->PopulateUI(
S);
1464 settings.extra.SetDuration(mDuration->GetValue());
1500 if (
mLib.IsLoaded())
1505 wxFileName ff =
mPath;
1507 bool hadpath = wxGetEnv(wxT(
"PATH"), &envpath);
1508 wxSetEnv(wxT(
"PATH"), ff.GetPath() + wxFILE_SEP_PATH + envpath);
1509 wxString saveOldCWD = ff.GetCwd();
1526 if (
mLib.IsLoaded())
1531 wxSetWorkingDirectory(saveOldCWD);
1532 hadpath ? wxSetEnv(wxT(
"PATH"), envpath) : wxUnsetEnv(wxT(
"PATH"));
1539 if (
mLib.IsLoaded())
1550 parms, wxEmptyString))
1580 group, wxT(
"Parameters"), parms);
1591 auto &controls =
settings.controls;
1615 auto &controls = mSettings.controls;
1617 controls[p] = mToggles[p]->GetValue();
1623 auto &controls = mSettings.controls;
1627 float lower = float(0.0);
1628 float upper = float(10.0);
1630 bool forceint =
false;
1638 lower *= mSampleRate;
1639 upper *= mSampleRate;
1643 range = upper - lower;
1644 val = (mSliders[p]->GetValue() / 1000.0) * range + lower;
1647 str.Printf(wxT(
"%d"), (int)(val + 0.5));
1651 mFields[p]->SetValue(
str);
1658 auto &controls = mSettings.controls;
1662 float lower = float(0.0);
1663 float upper = float(10.0);
1674 lower *= mSampleRate;
1675 upper *= mSampleRate;
1677 range = upper - lower;
1684 mSliders[p]->SetValue((
int)(((val-lower)/range) * 1000.0 + 0.5));
1693 auto &controls = mSettings.controls;
1696 const auto &data = *GetEffect().mData;
1697 for (
unsigned long p = 0; p < data.PortCount; ++p) {
1705 bool forceint =
false;
1713 mToggles[p]->SetValue(controls[p] > 0);
1718 fieldText.Printf(wxT(
"%d"), (
int)(controls[p] + 0.5));
1724 mFields[p]->SetValue(fieldText);
Declare abstract class AudacityException, some often-used subclasses, and GuardedCall.
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
const TranslatableString name
enum ChannelName * ChannelNames
std::vector< PluginPath > PluginPaths
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
std::vector< RegistryPath > RegistryPaths
DECLARE_PROVIDER_ENTRY(AudacityModule)
static const wxChar * kShippedEffects[]
static const wchar_t * UseLatencyKey
DECLARE_BUILTIN_PROVIDER(LadspaBuiltin)
static const wchar_t * OptionsKey
#define LADSPAEFFECTS_VERSION
#define LADSPAEFFECTS_FAMILY
wxEVT_COMMAND_TEXT_UPDATED
static Settings & settings()
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
void reinit(Integral count, bool initialize=false)
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,...
EffectDefinitionInterface is a ComponentInterface that adds some basic read-only information about ef...
Base class for many of the effects in Audacity.
bool ValidateUI(EffectSettings &) override
Performs effect computation.
Inherit to add a state variable to an EffectInstance subclass.
EffectUIClientInterface is an abstract base class to populate a UI and validate UI values....
Interface for transferring values from a panel of effect controls.
EffectUIClientInterface & mEffect
static LadspaEffectSettings & GetSettings(EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
static wxString ToDisplayString(double numberToConvert, int digitsAfterDecimalPoint=-1)
Convert a number to a string, uses the user's locale's decimal separator.
static bool CompatibleToDouble(const wxString &stringToConvert, double *result)
Convert a string to a number.
An Effect that calls up a LADSPA plug in, i.e. many possible effects from this one class.
bool LoadSettings(const CommandParameters &parms, EffectSettings &settings) const override
Restore settings from keys and values.
LadspaEffect(const wxString &path, int index)
bool CopySettingsContents(const EffectSettings &src, EffectSettings &dst) const override
Update one settings object from another.
EffectFamilySymbol GetFamily() const override
Report identifier and user-visible name of the effect protocol.
bool SupportsAutomation() const override
Whether the effect has any automatable controls.
static bool LoadUseLatency(const EffectDefinitionInterface &effect)
int GetMidiInCount() const override
Function that has not yet found a use.
std::unique_ptr< EffectUIValidator > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
Add controls to effect panel; always succeeds.
bool SaveSettings(const EffectSettings &settings, CommandParameters &parms) const override
Store settings as keys and values.
bool CanExportPresets() override
void ImportPresets(EffectSettings &settings) override
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
const LADSPA_Descriptor * mData
bool IsGraphicalUI() override
bool IsInteractive() const override
Whether the effect needs a dialog for entry of settings.
bool SaveParameters(const RegistryPath &group, const EffectSettings &settings) const
int GetMidiOutCount() const override
Function that has not yet found a use.
EffectType GetType() const override
Type determines how it behaves.
ComponentInterfaceSymbol GetSymbol() const override
static bool SaveUseLatency(const EffectDefinitionInterface &effect, bool value)
int ShowClientInterface(wxWindow &parent, wxDialog &dialog, bool forceModal) override
void FreeInstance(LADSPA_Handle handle) const
ArrayOf< unsigned long > mOutputPorts
unsigned GetAudioInCount() const override
How many input buffers to allocate at once.
LADSPA_Handle InitInstance(float sampleRate, LadspaEffectSettings &settings) const
bool SaveUserPreset(const RegistryPath &name, const EffectSettings &settings) const override
Save settings in the configuration file as a user-named preset.
bool HasOptions() override
wxString GetVersion() const override
void ShowOptions() override
void ExportPresets(const EffectSettings &settings) const override
bool LoadFactoryPreset(int id, EffectSettings &settings) const override
Change settings to the preset whose name is GetFactoryPresets()[id]
RegistryPaths GetFactoryPresets() const override
Report names of factory presets.
TranslatableString GetDescription() const override
bool InitializeControls(LadspaEffectSettings &settings) const
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
bool IsDefault() const override
Whether the effect sorts "above the line" in the menus.
bool FullyInitializePlugin()
PluginPath GetPath() const override
EffectSettings MakeSettings() const override
ArrayOf< unsigned long > mInputPorts
bool LoadParameters(const RegistryPath &group, EffectSettings &settings) const
VendorSymbol GetVendor() const override
bool SupportsRealtime() const override
Whether the effect supports realtime previewing (while audio is playing).
bool LoadUserPreset(const RegistryPath &name, EffectSettings &settings) const override
Change settings to a user-named preset.
void OnErase(wxEraseEvent &evt)
void OnSize(wxSizeEvent &evt)
LadspaEffectMeter(wxWindow *parent, const float &val, float min, float max)
void OnIdle(wxIdleEvent &evt)
virtual ~LadspaEffectMeter()
void OnPaint(wxPaintEvent &evt)
virtual ~LadspaEffectOptionsDialog()
LadspaEffectOptionsDialog(wxWindow *parent, EffectDefinitionInterface &effect, bool &var)
void PopulateOrExchange(ShuttleGui &S)
void OnOk(wxCommandEvent &evt)
EffectDefinitionInterface & mEffect
PluginPaths FindModulePaths(PluginManagerInterface &pm) override
virtual ~LadspaEffectsModule()
ComponentInterfaceSymbol GetSymbol() const override
std::unique_ptr< ComponentInterface > LoadPlugin(const PluginPath &path) override
Load the plug-in at a path reported by DiscoverPluginsAtPath.
FilePath InstallPath() override
Where plug-in files should be copied to install them.
TranslatableString GetDescription() const override
EffectFamilySymbol GetOptionalFamilySymbol() override
A symbol identifying the family of plug-ins provided by this.
bool IsPluginValid(const PluginPath &path, bool bFast) override
unsigned DiscoverPluginsAtPath(const PluginPath &path, TranslatableString &errMsg, const RegistrationCallback &callback) override
FilePaths GetSearchPaths()
const FileExtensions & GetFileExtensions() override
File types associated with this protocol.
VendorSymbol GetVendor() const override
void Terminate() override
Called just prior to deletion to allow releasing any resources.
wxString GetVersion() const override
bool Initialize() override
Called immediately after creation. Let provider initialize.
PluginPath GetPath() const override
void AutoRegisterPlugins(PluginManagerInterface &pm) override
Called so that a provider of a static set of plug-ins can register them.
Instance(const PerTrackEffect &processor)
const PerTrackEffect & mProcessor
virtual void FindFilesInPathList(const wxString &pattern, const FilePaths &pathList, FilePaths &files, bool directories=false)=0
virtual bool IsPluginRegistered(const PluginPath &path, const TranslatableString *pName=nullptr)=0
Was the plugin registry already populated for a path (maybe from loading the config file)?
static const PluginID & DefaultRegistrationCallback(PluginProvider *provider, ComponentInterface *ident)
std::function< const PluginID &(PluginProvider *, ComponentInterface *) > RegistrationCallback
Further expand a path reported by FindModulePaths.
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 ...
Positions or offsets within audio files need a wide type.
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
#define LADSPA_HINT_DEFAULT_100
#define LADSPA_IS_HINT_BOUNDED_BELOW(x)
#define LADSPA_HINT_DEFAULT_MAXIMUM
#define LADSPA_HINT_DEFAULT_440
#define LADSPA_HINT_DEFAULT_LOW
#define LADSPA_IS_HINT_BOUNDED_ABOVE(x)
#define LADSPA_HINT_DEFAULT_0
#define LADSPA_IS_HINT_INTEGER(x)
#define LADSPA_IS_HINT_LOGARITHMIC(x)
#define LADSPA_HINT_DEFAULT_HIGH
#define LADSPA_IS_HINT_TOGGLED(x)
#define LADSPA_HINT_DEFAULT_MASK
#define LADSPA_HINT_DEFAULT_MIDDLE
int LADSPA_PortDescriptor
#define LADSPA_HINT_DEFAULT_1
#define LADSPA_HINT_DEFAULT_MINIMUM
const LADSPA_Descriptor *(* LADSPA_Descriptor_Function)(unsigned long Index)
#define LADSPA_IS_PORT_INPUT(x)
#define LADSPA_IS_PORT_AUDIO(x)
#define LADSPA_IS_PORT_CONTROL(x)
#define LADSPA_IS_PORT_OUTPUT(x)
#define LADSPA_HINT_DEFAULT_NONE
#define LADSPA_IS_HINT_SAMPLE_RATE(x)
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
FILES_API FilePath PlugInDir()
The user plug-in directory (not a system one)
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)
float InputControlPortDefaultValue(const LADSPA_PortRangeHint &hint, double sampleRate)
std::pair< float, float > InputControlPortBounds(const LADSPA_PortRangeHint &hint, double sampleRate)
float ClampInputControlValue(const LADSPA_PortRangeHint &hint, float val, float lower, float upper)
_LADSPA_Descriptor is a structure that provides the API to a LADSPA (Linux Audio Plugin Architecture)...
LADSPA_Handle(* instantiate)(const struct _LADSPA_Descriptor *Descriptor, unsigned long SampleRate)
void(* deactivate)(LADSPA_Handle Instance)
void(* cleanup)(LADSPA_Handle Instance)
const char *const * PortNames
void(* activate)(LADSPA_Handle Instance)
void(* connect_port)(LADSPA_Handle Instance, unsigned long Port, LADSPA_Data *DataLocation)
const LADSPA_PortDescriptor * PortDescriptors
const LADSPA_PortRangeHint * PortRangeHints
_LADSPA_PortRangeHint is a structure that gives parameter validation information for a LADSPA (Linux ...
LADSPA_PortRangeHintDescriptor HintDescriptor
Externalized state of a plug-in.
size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override
Called for destructive effect computation.
size_t RealtimeProcess(size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples) override
bool RealtimeResume() override
bool RealtimeAddProcessor(EffectSettings &settings, unsigned numChannels, float sampleRate) override
bool RealtimeProcessEnd(EffectSettings &settings) noexcept override
settings can be updated to let a dialog change appearance at idle
bool RealtimeInitialize(EffectSettings &settings, double sampleRate) override
bool ProcessInitialize(EffectSettings &settings, double sampleRate, sampleCount totalLen, ChannelNames chanMap) override
bool RealtimeProcessStart(EffectSettings &settings) override
settings are possibly changed, since last call, by an asynchronous dialog
bool ProcessFinalize() override
bool RealtimeSuspend() override
std::vector< LADSPA_Handle > mSlaves
const LadspaEffect & GetEffect() const
bool RealtimeFinalize(EffectSettings &settings) noexcept override
sampleCount GetLatency(const EffectSettings &settings, double sampleRate) override
bool UpdateUI() override
Update appearance of the panel for changes in settings.
void OnSlider(wxCommandEvent &evt)
ArrayOf< wxTextCtrl * > mFields
bool ValidateUI() override
Get settings data from the panel; may make error dialogs and return false.
ArrayOf< wxStaticText * > mLabels
ArrayOf< wxSlider * > mSliders
wxWeakRef< wxDialog > mDialog
void PopulateUI(ShuttleGui &S)
void OnCheckBox(wxCommandEvent &evt)
ArrayOf< wxCheckBox * > mToggles
LadspaEffectSettings mSettings
const LadspaEffect & GetEffect()
ArrayOf< LadspaEffectMeter * > mMeters
void OnTextCtrl(wxCommandEvent &evt)
NumericTextCtrl * mDuration
Validator(EffectUIClientInterface &effect, EffectSettingsAccess &access, double sampleRate, EffectType type)
std::vector< float > controls
Options & AutoPos(bool enable)