2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
EffectsPrefs.cpp
|
|
|
|
|
|
|
|
Brian Gunlogson
|
|
|
|
Joshua Haberman
|
|
|
|
Dominic Mazzoni
|
|
|
|
James Crook
|
|
|
|
|
|
|
|
|
|
|
|
*******************************************************************//**
|
|
|
|
|
|
|
|
\class EffectsPrefs
|
2020-04-11 07:08:33 +00:00
|
|
|
\brief A PrefsPanel for general GUI preferences.
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
*//*******************************************************************/
|
|
|
|
|
2021-05-09 15:16:56 +00:00
|
|
|
|
2018-11-10 19:47:12 +00:00
|
|
|
#include "EffectsPrefs.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-11-22 18:16:03 +00:00
|
|
|
#include <wx/choice.h>
|
2010-01-23 19:44:49 +00:00
|
|
|
#include <wx/defs.h>
|
|
|
|
|
2021-02-17 02:14:33 +00:00
|
|
|
#include "Languages.h"
|
2019-04-08 13:38:27 +00:00
|
|
|
#include "../PluginManager.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
#include "../Prefs.h"
|
|
|
|
#include "../ShuttleGui.h"
|
|
|
|
|
2017-10-28 00:35:52 +00:00
|
|
|
EffectsPrefs::EffectsPrefs(wxWindow * parent, wxWindowID winid)
|
2019-12-08 02:00:39 +00:00
|
|
|
: PrefsPanel(parent, winid, XO("Effects"))
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
Populate();
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectsPrefs::~EffectsPrefs()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-04-15 12:01:24 +00:00
|
|
|
ComponentInterfaceSymbol EffectsPrefs::GetSymbol()
|
|
|
|
{
|
|
|
|
return EFFECTS_PREFS_PLUGIN_SYMBOL;
|
|
|
|
}
|
|
|
|
|
2019-12-08 18:53:48 +00:00
|
|
|
TranslatableString EffectsPrefs::GetDescription()
|
2019-04-15 12:01:24 +00:00
|
|
|
{
|
2019-12-08 18:53:48 +00:00
|
|
|
return XO("Preferences for Effects");
|
2019-04-15 12:01:24 +00:00
|
|
|
}
|
|
|
|
|
2021-06-06 16:18:35 +00:00
|
|
|
ManualPageID EffectsPrefs::HelpPageName()
|
2019-04-15 12:01:24 +00:00
|
|
|
{
|
|
|
|
return "Effects_Preferences";
|
|
|
|
}
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
void EffectsPrefs::Populate()
|
|
|
|
{
|
|
|
|
//------------------------- Main section --------------------
|
|
|
|
// Now construct the GUI itself.
|
2014-06-03 20:30:19 +00:00
|
|
|
// Use 'eIsCreatingFromPrefs' so that the GUI is
|
2010-01-23 19:44:49 +00:00
|
|
|
// initialised with values from gPrefs.
|
|
|
|
ShuttleGui S(this, eIsCreatingFromPrefs);
|
|
|
|
PopulateOrExchange(S);
|
|
|
|
// ----------------------- End of main section --------------
|
|
|
|
}
|
|
|
|
|
2019-02-26 10:56:27 +00:00
|
|
|
ChoiceSetting EffectsGroupBy{
|
|
|
|
wxT("/Effects/GroupBy"),
|
|
|
|
{
|
|
|
|
ByColumns,
|
|
|
|
{
|
|
|
|
XO("Sorted by Effect Name") ,
|
|
|
|
XO("Sorted by Publisher and Effect Name") ,
|
|
|
|
XO("Sorted by Type and Effect Name") ,
|
|
|
|
XO("Grouped by Publisher") ,
|
|
|
|
XO("Grouped by Type") ,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
wxT("sortby:name") ,
|
|
|
|
wxT("sortby:publisher:name") ,
|
|
|
|
wxT("sortby:type:name") ,
|
|
|
|
wxT("groupby:publisher") ,
|
|
|
|
wxT("groupby:type") ,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
0 // "sortby:name"
|
|
|
|
};
|
|
|
|
|
2019-04-08 13:38:27 +00:00
|
|
|
namespace {
|
2018-01-17 20:41:40 +00:00
|
|
|
|
2019-04-08 13:38:27 +00:00
|
|
|
// Rather than hard-code an exhaustive list of effect families in this file,
|
|
|
|
// pretend we don't know, but discover them instead by querying the module and
|
|
|
|
// effect managers.
|
|
|
|
|
|
|
|
// But then we would like to have prompts with accelerator characters that are
|
|
|
|
// distinct. We collect some prompts in the following map.
|
|
|
|
|
|
|
|
// It is not required that each module be found here, nor that each module
|
|
|
|
// mentioned here be found.
|
2019-11-30 18:32:18 +00:00
|
|
|
const std::map< wxString, TranslatableString > SuggestedPrompts{
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-04-08 00:38:20 +00:00
|
|
|
/* i18n-hint: Audio Unit is the name of an Apple audio software protocol */
|
2020-05-11 15:28:14 +00:00
|
|
|
{ wxT("AudioUnit"), XXO("Audio Unit") },
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-04-08 00:38:20 +00:00
|
|
|
/* i18n-hint: abbreviates "Linux Audio Developer's Simple Plugin API"
|
|
|
|
(Application programming interface)
|
|
|
|
*/
|
2020-05-11 15:28:14 +00:00
|
|
|
{ wxT("LADSPA"), XXO("&LADSPA") },
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-04-08 00:38:20 +00:00
|
|
|
/* i18n-hint: abbreviates
|
|
|
|
"Linux Audio Developer's Simple Plugin API (LADSPA) version 2" */
|
2020-05-11 15:28:14 +00:00
|
|
|
{ wxT("LV2"), XXO("LV&2") },
|
2019-04-08 13:38:27 +00:00
|
|
|
|
2019-04-08 00:38:20 +00:00
|
|
|
/* i18n-hint: "Nyquist" is an embedded interpreted programming language in
|
|
|
|
Audacity, named in honor of the Swedish-American Harry Nyquist (or Nyqvist).
|
|
|
|
In the translations of this and other strings, you may transliterate the
|
|
|
|
name into another alphabet. */
|
2020-05-11 15:28:14 +00:00
|
|
|
{ wxT("Nyquist"), XXO("N&yquist") },
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-04-08 00:38:20 +00:00
|
|
|
/* i18n-hint: Vamp is the proper name of a software protocol for sound analysis.
|
|
|
|
It is not an abbreviation for anything. See http://vamp-plugins.org */
|
2020-05-11 15:28:14 +00:00
|
|
|
{ wxT("Vamp"), XXO("&Vamp") },
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-04-08 00:38:20 +00:00
|
|
|
/* i18n-hint: Abbreviates Virtual Studio Technology, an audio software protocol
|
|
|
|
developed by Steinberg GmbH */
|
2020-05-11 15:28:14 +00:00
|
|
|
{ wxT("VST"), XXO("V&ST") },
|
2019-04-08 13:38:27 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
// Collect needed prompts and settings paths, at most once, on demand
|
|
|
|
struct Entry {
|
2019-11-30 18:32:18 +00:00
|
|
|
TranslatableString prompt;
|
2019-04-08 13:38:27 +00:00
|
|
|
wxString setting;
|
|
|
|
};
|
|
|
|
static const std::vector< Entry > &GetModuleData()
|
|
|
|
{
|
|
|
|
struct ModuleData : public std::vector< Entry > {
|
|
|
|
ModuleData() {
|
|
|
|
auto &pm = PluginManager::Get();
|
2021-06-19 12:58:07 +00:00
|
|
|
for (auto &plug : pm.PluginsOfType(PluginTypeModule)) {
|
|
|
|
auto internal = plug.GetEffectFamily();
|
2019-04-08 13:38:27 +00:00
|
|
|
if ( internal.empty() )
|
|
|
|
continue;
|
|
|
|
|
2019-11-30 18:32:18 +00:00
|
|
|
TranslatableString prompt;
|
2019-04-08 13:38:27 +00:00
|
|
|
auto iter = SuggestedPrompts.find( internal );
|
|
|
|
if ( iter == SuggestedPrompts.end() )
|
|
|
|
// For the built-in modules this Msgid includes " Effects",
|
|
|
|
// but those strings were never shown to the user,
|
|
|
|
// and the prompts in the table above do not include it.
|
|
|
|
// If there should be new modules, it is not important for them
|
|
|
|
// to follow the " Effects" convention, but instead they can
|
|
|
|
// have shorter msgids.
|
2021-06-19 12:58:07 +00:00
|
|
|
prompt = plug.GetSymbol().Msgid();
|
2019-04-08 13:38:27 +00:00
|
|
|
else
|
|
|
|
prompt = iter->second;
|
|
|
|
|
2021-06-19 12:58:07 +00:00
|
|
|
auto setting = pm.GetPluginEnabledSetting( plug );
|
2019-04-08 13:38:27 +00:00
|
|
|
|
|
|
|
push_back( { prompt, setting } );
|
|
|
|
}
|
|
|
|
// Guarantee some determinate ordering
|
|
|
|
std::sort( begin(), end(),
|
|
|
|
[]( const Entry &a, const Entry &b ){
|
|
|
|
return a.setting < b.setting;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
static ModuleData theData;
|
|
|
|
return theData;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsPrefs::PopulateOrExchange(ShuttleGui & S)
|
|
|
|
{
|
|
|
|
S.SetBorder(2);
|
|
|
|
S.StartScroller();
|
|
|
|
|
2019-12-22 19:58:36 +00:00
|
|
|
S.StartStatic(XO("Enable Effects"));
|
2019-04-08 13:38:27 +00:00
|
|
|
{
|
|
|
|
for ( const auto &entry : GetModuleData() )
|
|
|
|
{
|
|
|
|
S.TieCheckBox(
|
2019-12-04 18:52:39 +00:00
|
|
|
entry.prompt,
|
2019-04-03 14:57:59 +00:00
|
|
|
{entry.setting,
|
|
|
|
true}
|
2019-04-08 13:38:27 +00:00
|
|
|
);
|
|
|
|
}
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
S.EndStatic();
|
|
|
|
|
2019-12-22 19:58:36 +00:00
|
|
|
S.StartStatic(XO("Effect Options"));
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2014-11-04 01:38:13 +00:00
|
|
|
S.StartMultiColumn(2);
|
|
|
|
{
|
2018-01-31 20:31:22 +00:00
|
|
|
wxChoice *c = S
|
|
|
|
.MinSize()
|
2020-05-11 15:28:14 +00:00
|
|
|
.TieChoice( XXO("S&ort or Group:"), EffectsGroupBy);
|
2018-01-16 00:25:03 +00:00
|
|
|
|
2020-05-11 15:28:14 +00:00
|
|
|
S.TieIntegerTextBox(XXO("&Maximum effects per group (0 to disable):"),
|
2019-04-03 14:57:59 +00:00
|
|
|
{wxT("/Effects/MaxPerGroup"),
|
2014-12-14 16:02:41 +00:00
|
|
|
#if defined(__WXGTK__)
|
2019-04-03 14:57:59 +00:00
|
|
|
15
|
2014-12-14 16:02:41 +00:00
|
|
|
#else
|
2019-04-03 14:57:59 +00:00
|
|
|
0
|
2014-12-14 16:02:41 +00:00
|
|
|
#endif
|
2019-04-03 14:57:59 +00:00
|
|
|
},
|
2014-11-04 01:38:13 +00:00
|
|
|
5);
|
|
|
|
}
|
|
|
|
S.EndMultiColumn();
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
S.EndStatic();
|
|
|
|
|
2015-05-15 21:33:35 +00:00
|
|
|
#ifndef EXPERIMENTAL_EFFECT_MANAGEMENT
|
2019-12-22 19:58:36 +00:00
|
|
|
S.StartStatic(XO("Plugin Options"));
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2020-05-11 15:28:14 +00:00
|
|
|
S.TieCheckBox(XXO("Check for updated plugins when Audacity starts"),
|
2021-01-30 18:23:50 +00:00
|
|
|
{wxT("/Plugins/CheckForUpdates"),
|
|
|
|
true});
|
2020-05-11 15:28:14 +00:00
|
|
|
S.TieCheckBox(XXO("Rescan plugins next time Audacity is started"),
|
2021-01-30 18:23:50 +00:00
|
|
|
{wxT("/Plugins/Rescan"),
|
|
|
|
false});
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
S.EndStatic();
|
2015-05-15 21:33:35 +00:00
|
|
|
#endif
|
2014-01-16 17:55:35 +00:00
|
|
|
|
|
|
|
#ifdef EXPERIMENTAL_EQ_SSE_THREADED
|
2019-12-22 19:58:36 +00:00
|
|
|
S.StartStatic(XO("Instruction Set"));
|
2014-01-16 17:55:35 +00:00
|
|
|
{
|
2020-05-11 15:28:14 +00:00
|
|
|
S.TieCheckBox(XXO("&Use SSE/SSE2/.../AVX"),
|
2021-01-30 18:23:50 +00:00
|
|
|
{wxT("/SSE/GUI"),
|
|
|
|
true});
|
2014-01-16 17:55:35 +00:00
|
|
|
}
|
|
|
|
S.EndStatic();
|
|
|
|
#endif
|
2018-01-17 20:41:40 +00:00
|
|
|
S.EndScroller();
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
}
|
|
|
|
|
2017-06-25 14:57:26 +00:00
|
|
|
bool EffectsPrefs::Commit()
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
ShuttleGui S(this, eIsSavingToPrefs);
|
|
|
|
PopulateOrExchange(S);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2015-06-13 21:59:47 +00:00
|
|
|
|
2020-01-20 01:53:03 +00:00
|
|
|
namespace{
|
2019-01-16 17:18:40 +00:00
|
|
|
PrefsPanel::Registration sAttachment{ "Effects",
|
2020-01-20 01:53:03 +00:00
|
|
|
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
|
|
|
|
{
|
|
|
|
wxASSERT(parent); // to justify safenew
|
|
|
|
return safenew EffectsPrefs(parent, winid);
|
|
|
|
}
|
2019-01-14 01:55:52 +00:00
|
|
|
};
|
2020-01-20 01:53:03 +00:00
|
|
|
}
|