2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
Effect.h
|
|
|
|
|
|
|
|
Dominic Mazzoni
|
|
|
|
Vaughan Johnson
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
#ifndef __AUDACITY_EFFECT__
|
|
|
|
#define __AUDACITY_EFFECT__
|
|
|
|
|
2021-05-09 15:16:56 +00:00
|
|
|
|
2018-11-11 02:40:37 +00:00
|
|
|
|
2019-07-21 16:13:47 +00:00
|
|
|
#include <functional>
|
2010-01-23 19:44:49 +00:00
|
|
|
#include <set>
|
|
|
|
|
2016-08-07 21:25:35 +00:00
|
|
|
#include <wx/defs.h>
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-11-14 20:01:44 +00:00
|
|
|
class wxButton;
|
2015-06-18 14:24:36 +00:00
|
|
|
class wxCheckBox;
|
|
|
|
class wxChoice;
|
|
|
|
class wxListBox;
|
2010-01-23 19:44:49 +00:00
|
|
|
class wxWindow;
|
|
|
|
|
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
|
|
|
#include "audacity/ConfigInterface.h"
|
|
|
|
#include "audacity/EffectInterface.h"
|
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
#include "../SelectedRegion.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-03-13 15:08:21 +00:00
|
|
|
#include "../Track.h"
|
|
|
|
|
2019-03-31 20:12:07 +00:00
|
|
|
#include "../widgets/wxPanelWrapper.h" // to inherit
|
|
|
|
|
2018-11-12 00:47:44 +00:00
|
|
|
class wxArrayString;
|
2015-06-18 14:24:36 +00:00
|
|
|
class ShuttleGui;
|
Automation: AudacityCommand
This is a squash of 50 commits.
This merges the capabilities of BatchCommands and Effects using a new
AudacityCommand class. AudacityCommand provides one function to specify the
parameters, and then we leverage that one function in automation, whether by chains,
mod-script-pipe or (future) Nyquist.
- Now have AudacityCommand which is using the same mechanism as Effect
- Has configurable parameters
- Has data-entry GUI (built using shuttle GUI)
- Registers with PluginManager.
- Menu commands now provided in chains, and to python batch.
- Tested with Zoom Toggle.
- ShuttleParams now can set, get, set defaults, validate and specify
the parameters.
- Bugfix: Don't overwrite values with defaults first time out.
- Add DefineParams function for all built-in effects.
- Extend CommandContext to carry output channels for results.
We abuse EffectsManager. It handles both Effects and
AudacityCommands now. In time an Effect should become a special case of
AudacityCommand and we'll split and rename the EffectManager class.
- Don't use 'default' as a parameter name.
- Massive renaming for CommandDefinitionInterface
- EffectIdentInterface becomes EffectDefinitionInterface
- EffectAutomationParameters becomes CommandAutomationParameters
- PluginType is now a bit field.
This way we can search for related types at the same time.
- Most old batch commands made into AudacityCommands.
The ones that weren't are for a reason. They are used by mod-script-pipe
to carry commands and responses across from a non-GUI thread to the GUI
thread.
- Major tidy up of ScreenshotCommand
- Reworking of SelectCommand
- GetPreferenceCommand and SetPreferenceCommand
- GetTrackInfo and SetTrackInfo
- GetInfoCommand
- Help, Open, Save, Import and Export commands.
- Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo
which are now better handled by other commands.
- JSONify "GetInfo: Commands" output, i.e. commas in the right places.
- General work on better Doxygen.
- Lyrics -> LyricsPanel
- Meter -> MeterPanel
- Updated Linux makefile.
- Scripting commands added into Extra menu.
- Distinct names for previously duplicated find-clipping parameters.
- Fixed longstanding error with erroneous status field number which
previously caused an ASSERT in debug.
- Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
|
|
|
class AudacityCommand;
|
2015-06-18 14:24:36 +00:00
|
|
|
|
2015-06-09 19:00:54 +00:00
|
|
|
#define BUILTIN_EFFECT_PREFIX wxT("Built-in Effect: ")
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2015-07-03 04:20:21 +00:00
|
|
|
class AudacityProject;
|
2016-02-27 19:24:57 +00:00
|
|
|
class LabelTrack;
|
2018-02-16 23:07:59 +00:00
|
|
|
class NotifyingSelectedRegion;
|
2019-03-31 20:12:07 +00:00
|
|
|
class ProgressDialog;
|
2014-10-05 17:10:09 +00:00
|
|
|
class SelectedRegion;
|
2014-12-13 18:24:11 +00:00
|
|
|
class EffectUIHost;
|
2015-07-03 04:20:21 +00:00
|
|
|
class Track;
|
|
|
|
class TrackList;
|
2020-08-22 23:44:49 +00:00
|
|
|
class WaveTrackFactory;
|
2015-07-03 04:20:21 +00:00
|
|
|
class WaveTrack;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-06-23 12:09:58 +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. */
|
|
|
|
#define NYQUISTEFFECTS_FAMILY ( EffectFamilySymbol{ XO("Nyquist") } )
|
|
|
|
|
|
|
|
#define NYQUIST_WORKER_ID wxT("Nyquist Worker")
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// TODO: Apr-06-2015
|
|
|
|
// TODO: Much more cleanup of old methods and variables is needed, but
|
2016-02-13 15:43:16 +00:00
|
|
|
// TODO: can't be done until after all effects are using the NEW API.
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2016-02-24 06:06:39 +00:00
|
|
|
class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
|
2015-04-17 03:53:42 +00:00
|
|
|
public EffectClientInterface,
|
|
|
|
public EffectUIClientInterface,
|
|
|
|
public EffectHostInterface
|
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
|
|
|
{
|
2014-06-03 20:30:19 +00:00
|
|
|
//
|
2010-01-23 19:44:49 +00:00
|
|
|
// public methods
|
|
|
|
//
|
|
|
|
// Used by the outside program to determine properties of an effect and
|
|
|
|
// apply the effect to one or more tracks.
|
2014-06-03 20:30:19 +00:00
|
|
|
//
|
2010-01-23 19:44:49 +00:00
|
|
|
public:
|
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
|
|
|
// The constructor is called once by each subclass at the beginning of the program.
|
|
|
|
// Avoid allocating memory or doing time-consuming processing here.
|
|
|
|
Effect();
|
|
|
|
virtual ~Effect();
|
|
|
|
|
2019-05-11 22:49:02 +00:00
|
|
|
// Type of a registered function that, if it returns true,
|
|
|
|
// causes ShowInterface to return early without making any dialog
|
|
|
|
using VetoDialogHook = bool (*) ( wxDialog* );
|
|
|
|
static VetoDialogHook SetVetoDialogHook( VetoDialogHook hook );
|
|
|
|
|
2018-11-02 15:31:44 +00:00
|
|
|
// ComponentInterface implementation
|
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
|
|
|
|
2019-02-28 00:58:02 +00:00
|
|
|
PluginPath GetPath() override;
|
2018-02-04 21:25:08 +00:00
|
|
|
|
2018-11-02 15:31:44 +00:00
|
|
|
ComponentInterfaceSymbol GetSymbol() override;
|
2018-02-04 21:25:08 +00:00
|
|
|
|
2019-02-28 18:16:09 +00:00
|
|
|
VendorSymbol GetVendor() override;
|
2016-02-24 06:06:47 +00:00
|
|
|
wxString GetVersion() override;
|
2019-12-08 18:53:48 +00:00
|
|
|
TranslatableString GetDescription() override;
|
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
|
|
|
|
Automation: AudacityCommand
This is a squash of 50 commits.
This merges the capabilities of BatchCommands and Effects using a new
AudacityCommand class. AudacityCommand provides one function to specify the
parameters, and then we leverage that one function in automation, whether by chains,
mod-script-pipe or (future) Nyquist.
- Now have AudacityCommand which is using the same mechanism as Effect
- Has configurable parameters
- Has data-entry GUI (built using shuttle GUI)
- Registers with PluginManager.
- Menu commands now provided in chains, and to python batch.
- Tested with Zoom Toggle.
- ShuttleParams now can set, get, set defaults, validate and specify
the parameters.
- Bugfix: Don't overwrite values with defaults first time out.
- Add DefineParams function for all built-in effects.
- Extend CommandContext to carry output channels for results.
We abuse EffectsManager. It handles both Effects and
AudacityCommands now. In time an Effect should become a special case of
AudacityCommand and we'll split and rename the EffectManager class.
- Don't use 'default' as a parameter name.
- Massive renaming for CommandDefinitionInterface
- EffectIdentInterface becomes EffectDefinitionInterface
- EffectAutomationParameters becomes CommandAutomationParameters
- PluginType is now a bit field.
This way we can search for related types at the same time.
- Most old batch commands made into AudacityCommands.
The ones that weren't are for a reason. They are used by mod-script-pipe
to carry commands and responses across from a non-GUI thread to the GUI
thread.
- Major tidy up of ScreenshotCommand
- Reworking of SelectCommand
- GetPreferenceCommand and SetPreferenceCommand
- GetTrackInfo and SetTrackInfo
- GetInfoCommand
- Help, Open, Save, Import and Export commands.
- Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo
which are now better handled by other commands.
- JSONify "GetInfo: Commands" output, i.e. commas in the right places.
- General work on better Doxygen.
- Lyrics -> LyricsPanel
- Meter -> MeterPanel
- Updated Linux makefile.
- Scripting commands added into Extra menu.
- Distinct names for previously duplicated find-clipping parameters.
- Fixed longstanding error with erroneous status field number which
previously caused an ASSERT in debug.
- Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
|
|
|
// EffectDefinitionInterface implementation
|
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
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
EffectType GetType() override;
|
2019-02-28 18:16:09 +00:00
|
|
|
EffectFamilySymbol GetFamily() override;
|
2016-02-24 06:06:47 +00:00
|
|
|
bool IsInteractive() override;
|
|
|
|
bool IsDefault() override;
|
|
|
|
bool IsLegacy() override;
|
|
|
|
bool SupportsRealtime() override;
|
|
|
|
bool SupportsAutomation() override;
|
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
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// EffectClientInterface implementation
|
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
bool SetHost(EffectHostInterface *host) override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2016-09-02 19:53:09 +00:00
|
|
|
unsigned GetAudioInCount() override;
|
|
|
|
unsigned GetAudioOutCount() override;
|
2016-02-24 06:06:47 +00:00
|
|
|
|
|
|
|
int GetMidiInCount() override;
|
|
|
|
int GetMidiOutCount() override;
|
|
|
|
|
|
|
|
sampleCount GetLatency() override;
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t GetTailSize() override;
|
2016-02-24 06:06:47 +00:00
|
|
|
|
2016-08-20 22:10:36 +00:00
|
|
|
void SetSampleRate(double rate) override;
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t SetBlockSize(size_t maxBlockSize) override;
|
2019-06-23 23:19:32 +00:00
|
|
|
size_t GetBlockSize() const override;
|
2016-02-24 06:06:47 +00:00
|
|
|
|
|
|
|
bool IsReady() override;
|
|
|
|
bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap = NULL) override;
|
|
|
|
bool ProcessFinalize() override;
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen) override;
|
2016-02-24 06:06:47 +00:00
|
|
|
|
|
|
|
bool RealtimeInitialize() override;
|
2016-09-02 19:53:09 +00:00
|
|
|
bool RealtimeAddProcessor(unsigned numChannels, float sampleRate) override;
|
2016-02-24 06:06:47 +00:00
|
|
|
bool RealtimeFinalize() override;
|
|
|
|
bool RealtimeSuspend() override;
|
|
|
|
bool RealtimeResume() override;
|
|
|
|
bool RealtimeProcessStart() override;
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t RealtimeProcess(int group,
|
2015-04-17 03:53:42 +00:00
|
|
|
float **inbuf,
|
|
|
|
float **outbuf,
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t numSamples) override;
|
2016-02-24 06:06:47 +00:00
|
|
|
bool RealtimeProcessEnd() override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2020-01-06 15:09:18 +00:00
|
|
|
bool ShowInterface( wxWindow &parent,
|
2019-07-21 16:13:47 +00:00
|
|
|
const EffectDialogFactory &factory, bool forceModal = false) override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2018-02-21 14:24:25 +00:00
|
|
|
bool GetAutomationParameters(CommandParameters & parms) override;
|
|
|
|
bool SetAutomationParameters(CommandParameters & parms) override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool LoadUserPreset(const RegistryPath & name) override;
|
|
|
|
bool SaveUserPreset(const RegistryPath & name) override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
RegistryPaths GetFactoryPresets() override;
|
2016-02-24 06:06:47 +00:00
|
|
|
bool LoadFactoryPreset(int id) override;
|
|
|
|
bool LoadFactoryDefaults() override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
// EffectUIClientInterface implementation
|
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
void SetHostUI(EffectUIHostInterface *host) override;
|
2017-10-26 12:51:41 +00:00
|
|
|
bool PopulateUI(ShuttleGui &S) final;
|
2016-02-24 06:06:47 +00:00
|
|
|
bool IsGraphicalUI() override;
|
|
|
|
bool ValidateUI() override;
|
|
|
|
bool HideUI() override;
|
|
|
|
bool CloseUI() override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
bool CanExportPresets() override;
|
|
|
|
void ExportPresets() override;
|
|
|
|
void ImportPresets() override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2020-03-08 20:18:47 +00:00
|
|
|
static CommandID GetSquashedName(wxString name);
|
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
bool HasOptions() override;
|
|
|
|
void ShowOptions() override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
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
|
|
|
// EffectHostInterface implementation
|
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
double GetDefaultDuration() override;
|
|
|
|
double GetDuration() override;
|
2019-02-28 18:16:09 +00:00
|
|
|
NumericFormatSymbol GetDurationFormat() override;
|
|
|
|
virtual NumericFormatSymbol GetSelectionFormat() /* not override? */; // time format in Selection toolbar
|
2016-02-24 06:06:47 +00:00
|
|
|
void SetDuration(double duration) override;
|
2014-11-07 09:54:04 +00:00
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
RegistryPath GetUserPresetsGroup(const RegistryPath & name) override;
|
|
|
|
RegistryPath GetCurrentSettingsGroup() override;
|
|
|
|
RegistryPath GetFactoryDefaultsGroup() override;
|
2016-02-23 20:23:20 +00:00
|
|
|
virtual wxString GetSavedStateGroup() /* not override? */;
|
2014-11-14 03:03:17 +00:00
|
|
|
|
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
|
|
|
// ConfigClientInterface implementation
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool HasSharedConfigGroup(const RegistryPath & group) override;
|
|
|
|
bool GetSharedConfigSubgroups(const RegistryPath & group, RegistryPaths &subgroups) override;
|
2016-02-24 06:06:47 +00:00
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval = {}) override;
|
|
|
|
bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval = 0) override;
|
|
|
|
bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval = false) override;
|
|
|
|
bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval = 0.0) override;
|
|
|
|
bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval = 0.0) override;
|
2016-02-24 06:06:47 +00:00
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value) override;
|
|
|
|
bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const int & value) override;
|
|
|
|
bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const bool & value) override;
|
|
|
|
bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const float & value) override;
|
|
|
|
bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const double & value) override;
|
2016-02-24 06:06:47 +00:00
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool RemoveSharedConfigSubgroup(const RegistryPath & group) override;
|
|
|
|
bool RemoveSharedConfig(const RegistryPath & group, const RegistryPath & key) override;
|
2016-02-24 06:06:47 +00:00
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool HasPrivateConfigGroup(const RegistryPath & group) override;
|
|
|
|
bool GetPrivateConfigSubgroups(const RegistryPath & group, RegistryPaths &paths) override;
|
2016-02-24 06:06:47 +00:00
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval = {}) override;
|
|
|
|
bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval = 0) override;
|
|
|
|
bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval = false) override;
|
|
|
|
bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval = 0.0) override;
|
|
|
|
bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval = 0.0) override;
|
2016-02-24 06:06:47 +00:00
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value) override;
|
|
|
|
bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const int & value) override;
|
|
|
|
bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const bool & value) override;
|
|
|
|
bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const float & value) override;
|
|
|
|
bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const double & value) override;
|
2016-02-24 06:06:47 +00:00
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool RemovePrivateConfigSubgroup(const RegistryPath & group) override;
|
|
|
|
bool RemovePrivateConfig(const RegistryPath & group, const RegistryPath & key) override;
|
2014-11-14 03:03:17 +00:00
|
|
|
|
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
|
|
|
// Effect implementation
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
// NEW virtuals
|
2015-01-19 16:28:48 +00:00
|
|
|
virtual PluginID GetID();
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2014-11-05 20:41:29 +00:00
|
|
|
virtual bool Startup(EffectClientInterface *client);
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual bool Startup();
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
virtual bool GetAutomationParameters(wxString & parms);
|
|
|
|
virtual bool SetAutomationParameters(const wxString & parms);
|
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
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
virtual RegistryPaths GetUserPresets();
|
2015-04-26 21:41:05 +00:00
|
|
|
virtual bool HasCurrentSettings();
|
|
|
|
virtual bool HasFactoryDefaults();
|
|
|
|
|
2017-05-19 17:20:05 +00:00
|
|
|
// Name of page in the Audacity alpha manual
|
2021-06-06 16:18:35 +00:00
|
|
|
virtual ManualPageID ManualPage();
|
2017-05-19 17:20:05 +00:00
|
|
|
// Fully qualified local help file name
|
2021-06-06 16:18:35 +00:00
|
|
|
virtual FilePath HelpPage();
|
2017-05-15 21:00:33 +00:00
|
|
|
|
2021-02-03 11:02:49 +00:00
|
|
|
virtual void SetUIFlags(unsigned flags);
|
|
|
|
virtual unsigned TestUIFlags(unsigned mask);
|
2015-04-26 21:41:05 +00:00
|
|
|
virtual bool IsBatchProcessing();
|
2015-04-27 14:22:47 +00:00
|
|
|
virtual void SetBatchProcessing(bool start);
|
2015-04-26 21:41:05 +00:00
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
/* not virtual */ void SetPresetParameters( const wxArrayString * Names, const wxArrayString * Values ) {
|
2014-10-24 20:27:04 +00:00
|
|
|
if( Names ) mPresetNames = *Names;
|
|
|
|
if( Values ) mPresetValues = *Values;
|
|
|
|
}
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// Returns true on success. Will only operate on tracks that
|
|
|
|
// have the "selected" flag set to true, which is consistent with
|
|
|
|
// Audacity's standard UI.
|
2019-07-21 16:13:47 +00:00
|
|
|
// Create a user interface only if the supplied function is not null.
|
2020-01-08 21:33:09 +00:00
|
|
|
/* not virtual */ bool DoEffect( double projectRate, TrackList *list,
|
2020-08-22 23:44:49 +00:00
|
|
|
WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion,
|
2020-01-08 21:33:09 +00:00
|
|
|
// Prompt the user for input only if these arguments are both not null.
|
|
|
|
wxWindow *pParent = nullptr,
|
|
|
|
const EffectDialogFactory &dialogFactory = {} );
|
2014-11-03 06:48:54 +00:00
|
|
|
|
2020-04-16 16:33:48 +00:00
|
|
|
bool Delegate( Effect &delegate,
|
|
|
|
wxWindow &parent, const EffectDialogFactory &factory );
|
2016-12-29 15:36:37 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual bool IsHidden();
|
2017-09-07 03:35:54 +00:00
|
|
|
|
|
|
|
// Nonvirtual
|
|
|
|
// Display a message box, using effect's (translated) name as the prefix
|
|
|
|
// for the title.
|
|
|
|
enum : long { DefaultMessageBoxStyle = wxOK | wxCENTRE };
|
2019-12-19 19:19:51 +00:00
|
|
|
int MessageBox(const TranslatableString& message,
|
2017-09-07 03:35:54 +00:00
|
|
|
long style = DefaultMessageBoxStyle,
|
2019-12-19 19:19:51 +00:00
|
|
|
const TranslatableString& titleStr = {});
|
2017-09-07 03:35:54 +00:00
|
|
|
|
2018-02-24 10:31:50 +00:00
|
|
|
static void IncEffectCounter(){ nEffectsDone++;};
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
//
|
|
|
|
// protected virtual methods
|
|
|
|
//
|
|
|
|
// Each subclass of Effect overrides one or more of these methods to
|
|
|
|
// do its processing.
|
|
|
|
//
|
|
|
|
protected:
|
2017-09-07 03:35:54 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// Called once each time an effect is called. Perform any initialization;
|
|
|
|
// make sure that the effect can be performed on the selected tracks and
|
|
|
|
// return false otherwise
|
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
|
|
|
virtual bool Init();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
// Check whether effect should be skipped
|
|
|
|
// Typically this is only useful in automation, for example
|
|
|
|
// detecting that zero noise reduction is to be done,
|
2014-06-03 20:30:19 +00:00
|
|
|
// or that normalisation is being done without Dc bias shift
|
2010-01-23 19:44:49 +00:00
|
|
|
// or amplitude modification
|
|
|
|
virtual bool CheckWhetherSkipEffect() { return false; }
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// Actually do the effect here.
|
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
|
|
|
virtual bool Process();
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual bool ProcessPass();
|
|
|
|
virtual bool InitPass1();
|
|
|
|
virtual bool InitPass2();
|
|
|
|
virtual int GetPass();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
// clean up any temporary memory, needed only per invocation of the
|
|
|
|
// effect, after either successful or failed or exception-aborted processing.
|
|
|
|
// Invoked inside a "finally" block so it must be no-throw.
|
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
|
|
|
virtual void End();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// Most effects just use the previewLength, but time-stretching/compressing
|
|
|
|
// effects need to use a different input length, so override this method.
|
|
|
|
virtual double CalcPreviewInputLength(double previewLength);
|
2014-10-24 20:27:04 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// The Effect class fully implements the Preview method for you.
|
|
|
|
// Only override it if you need to do preprocessing or cleanup.
|
|
|
|
virtual void Preview(bool dryOnly);
|
|
|
|
|
|
|
|
virtual void PopulateOrExchange(ShuttleGui & S);
|
2017-10-01 17:28:04 +00:00
|
|
|
virtual bool TransferDataToWindow() /* not override */;
|
|
|
|
virtual bool TransferDataFromWindow() /* not override */;
|
2015-04-17 03:53:42 +00:00
|
|
|
virtual bool EnableApply(bool enable = true);
|
|
|
|
virtual bool EnablePreview(bool enable = true);
|
2015-04-22 20:55:58 +00:00
|
|
|
virtual void EnableDebug(bool enable = true);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
// No more virtuals!
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// The Progress methods all return true if the user has cancelled;
|
|
|
|
// you should exit immediately if this happens (cleaning up memory
|
|
|
|
// is okay, but don't try to undo).
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// Pass a fraction between 0.0 and 1.0
|
2019-12-08 03:37:02 +00:00
|
|
|
bool TotalProgress(double frac, const TranslatableString & = {});
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// Pass a fraction between 0.0 and 1.0, for the current track
|
|
|
|
// (when doing one track at a time)
|
2019-12-08 03:37:02 +00:00
|
|
|
bool TrackProgress(int whichTrack, double frac, const TranslatableString & = {});
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// Pass a fraction between 0.0 and 1.0, for the current track group
|
|
|
|
// (when doing stereo groups at a time)
|
2019-12-08 03:37:02 +00:00
|
|
|
bool TrackGroupProgress(int whichGroup, double frac, const TranslatableString & = {});
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
int GetNumWaveTracks() { return mNumTracks; }
|
|
|
|
int GetNumWaveGroups() { return mNumGroups; }
|
|
|
|
|
2020-03-21 21:52:29 +00:00
|
|
|
// Calculates the start time and length in samples for one or two channels
|
|
|
|
void GetBounds(
|
|
|
|
const WaveTrack &track, const WaveTrack *pRight,
|
|
|
|
sampleCount *start, sampleCount *len);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-05-15 11:47:51 +00:00
|
|
|
// Previewing linear effect can be optimised by pre-mixing. However this
|
|
|
|
// should not be used for non-linear effects such as dynamic processors
|
|
|
|
// To allow pre-mixing before Preview, set linearEffectFlag to true.
|
|
|
|
void SetLinearEffectFlag(bool linearEffectFlag);
|
|
|
|
|
2015-05-28 16:31:07 +00:00
|
|
|
// Most effects only need to preview a short selection. However some
|
|
|
|
// (such as fade effects) need to know the full selection length.
|
|
|
|
void SetPreviewFullSelectionFlag(bool previewDurationFlag);
|
|
|
|
|
2016-01-02 09:00:40 +00:00
|
|
|
// Use this if the effect needs to know if it is previewing
|
|
|
|
bool IsPreviewing() { return mIsPreview; }
|
|
|
|
|
2015-05-15 15:57:29 +00:00
|
|
|
// Most effects only require selected tracks to be copied for Preview.
|
|
|
|
// If IncludeNotSelectedPreviewTracks(true), then non-linear effects have
|
|
|
|
// preview copies of all wave tracks.
|
|
|
|
void IncludeNotSelectedPreviewTracks(bool includeNotSelected);
|
|
|
|
|
2016-12-31 09:54:52 +00:00
|
|
|
// Use this method to copy the input tracks to mOutputTracks, if
|
2010-01-23 19:44:49 +00:00
|
|
|
// doing the processing on them, and replacing the originals only on success (and not cancel).
|
2016-12-31 09:54:52 +00:00
|
|
|
// If not all sync-locked selected, then only selected wave tracks.
|
|
|
|
void CopyInputTracks(bool allSyncLockSelected = false);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-02-24 10:31:50 +00:00
|
|
|
// A global counter of all the successful Effect invocations.
|
|
|
|
static int nEffectsDone;
|
|
|
|
|
2016-02-27 19:24:57 +00:00
|
|
|
// For the use of analyzers, which don't need to make output wave tracks,
|
|
|
|
// but may need to add label tracks.
|
2020-09-28 12:50:18 +00:00
|
|
|
class AUDACITY_DLL_API AddedAnalysisTrack {
|
2016-02-27 19:24:57 +00:00
|
|
|
friend Effect;
|
|
|
|
AddedAnalysisTrack(Effect *pEffect, const wxString &name);
|
|
|
|
AddedAnalysisTrack(const AddedAnalysisTrack&) PROHIBITED;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
AddedAnalysisTrack() {}
|
|
|
|
|
|
|
|
// So you can have a vector of them
|
|
|
|
AddedAnalysisTrack(AddedAnalysisTrack &&that);
|
|
|
|
|
|
|
|
LabelTrack *get() const { return mpTrack; }
|
|
|
|
|
|
|
|
// Call this to indicate successful completion of the analyzer.
|
|
|
|
void Commit();
|
|
|
|
|
|
|
|
// Destructor undoes the addition of the analysis track if not committed.
|
|
|
|
~AddedAnalysisTrack();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Effect *mpEffect{};
|
|
|
|
LabelTrack *mpTrack{};
|
|
|
|
};
|
|
|
|
|
|
|
|
// Set name to given value if that is not empty, else use default name
|
2016-03-07 06:29:26 +00:00
|
|
|
std::shared_ptr<AddedAnalysisTrack> AddAnalysisTrack(const wxString &name = wxString());
|
2016-02-27 19:24:57 +00:00
|
|
|
|
|
|
|
// For the use of analyzers, which don't need to make output wave tracks,
|
|
|
|
// but may need to modify label tracks.
|
2020-09-28 12:50:18 +00:00
|
|
|
class AUDACITY_DLL_API ModifiedAnalysisTrack {
|
2016-02-27 19:24:57 +00:00
|
|
|
friend Effect;
|
|
|
|
ModifiedAnalysisTrack
|
|
|
|
(Effect *pEffect, const LabelTrack *pOrigTrack, const wxString &name);
|
|
|
|
ModifiedAnalysisTrack(const ModifiedAnalysisTrack&) PROHIBITED;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
ModifiedAnalysisTrack();
|
|
|
|
|
|
|
|
// So you can have a vector of them
|
|
|
|
ModifiedAnalysisTrack(ModifiedAnalysisTrack &&that);
|
|
|
|
|
|
|
|
LabelTrack *get() const { return mpTrack; }
|
|
|
|
|
|
|
|
// Call this to indicate successful completion of the analyzer.
|
|
|
|
void Commit();
|
|
|
|
|
|
|
|
// Destructor undoes the modification of the analysis track if not committed.
|
|
|
|
~ModifiedAnalysisTrack();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Effect *mpEffect{};
|
|
|
|
LabelTrack *mpTrack{};
|
2017-06-22 23:25:46 +00:00
|
|
|
std::shared_ptr<Track> mpOrigTrack{};
|
2016-02-27 19:24:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Set name to given value if that is not empty, else use default name
|
|
|
|
ModifiedAnalysisTrack ModifyAnalysisTrack
|
|
|
|
(const LabelTrack *pOrigTrack, const wxString &name = wxString());
|
|
|
|
|
2014-06-03 20:30:19 +00:00
|
|
|
// If bGoodResult, replace mWaveTracks tracks in mTracks with successfully processed
|
|
|
|
// mOutputTracks copies, get rid of old mWaveTracks, and set mWaveTracks to mOutputTracks.
|
2016-02-14 23:50:45 +00:00
|
|
|
// Else clear and DELETE mOutputTracks copies.
|
2010-01-23 19:44:49 +00:00
|
|
|
void ReplaceProcessedTracks(const bool bGoodResult);
|
|
|
|
|
2016-02-13 15:43:16 +00:00
|
|
|
// Use this to append a NEW output track.
|
2018-11-19 04:07:05 +00:00
|
|
|
Track *AddToOutputTracks(const std::shared_ptr<Track> &t);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
//
|
|
|
|
// protected data
|
|
|
|
//
|
|
|
|
// The Effect base class will set these variables, some or all of which
|
|
|
|
// may be needed by any particular subclass of Effect.
|
|
|
|
//
|
|
|
|
protected:
|
2017-06-02 22:52:53 +00:00
|
|
|
|
2016-02-01 01:39:24 +00:00
|
|
|
ProgressDialog *mProgress; // Temporary pointer, NOT deleted in destructor.
|
2016-02-13 15:43:16 +00:00
|
|
|
double mProjectRate; // Sample rate of the project - NEW tracks should
|
2015-04-17 03:53:42 +00:00
|
|
|
// be created with this rate...
|
|
|
|
double mSampleRate;
|
2018-02-16 23:07:59 +00:00
|
|
|
wxWeakRef<NotifyingSelectedRegion> mpSelectedRegion{};
|
2020-08-22 23:44:49 +00:00
|
|
|
WaveTrackFactory *mFactory;
|
2016-12-31 09:33:35 +00:00
|
|
|
const TrackList *inputTracks() const { return mTracks; }
|
2019-05-21 18:38:43 +00:00
|
|
|
const AudacityProject *FindProject() const;
|
2017-07-14 13:22:22 +00:00
|
|
|
std::shared_ptr<TrackList> mOutputTracks; // used only if CopyInputTracks() is called.
|
2015-04-17 03:53:42 +00:00
|
|
|
double mT0;
|
|
|
|
double mT1;
|
|
|
|
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
|
|
|
|
double mF0;
|
|
|
|
double mF1;
|
|
|
|
#endif
|
|
|
|
wxArrayString mPresetNames;
|
|
|
|
wxArrayString mPresetValues;
|
|
|
|
int mPass;
|
|
|
|
|
|
|
|
// UI
|
|
|
|
wxDialog *mUIDialog;
|
|
|
|
wxWindow *mUIParent;
|
2015-04-22 20:55:58 +00:00
|
|
|
int mUIResultID;
|
2021-02-03 11:02:49 +00:00
|
|
|
unsigned mUIFlags;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2015-04-22 20:55:58 +00:00
|
|
|
sampleCount mSampleCnt;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// Used only by the base Effect class
|
|
|
|
//
|
|
|
|
private:
|
|
|
|
void CountWaveTracks();
|
2014-06-03 20:30:19 +00:00
|
|
|
|
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
|
|
|
// Driver for client effects
|
|
|
|
bool ProcessTrack(int count,
|
2015-04-17 03:53:42 +00:00
|
|
|
ChannelNames map,
|
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
|
|
|
WaveTrack *left,
|
|
|
|
WaveTrack *right,
|
2020-03-21 21:52:29 +00:00
|
|
|
sampleCount start,
|
2016-12-16 18:27:24 +00:00
|
|
|
sampleCount len,
|
|
|
|
FloatBuffers &inBuffer,
|
|
|
|
FloatBuffers &outBuffer,
|
|
|
|
ArrayOf< float * > &inBufPos,
|
|
|
|
ArrayOf< float *> &outBufPos);
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
//
|
|
|
|
// private data
|
|
|
|
//
|
|
|
|
// Used only by the base Effect class
|
|
|
|
//
|
2015-04-17 03:53:42 +00:00
|
|
|
private:
|
2016-12-29 15:36:37 +00:00
|
|
|
TrackList *mTracks; // the complete list of all tracks
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2015-04-26 21:41:05 +00:00
|
|
|
bool mIsBatch;
|
2015-05-15 11:47:51 +00:00
|
|
|
bool mIsLinearEffect;
|
2015-05-15 15:57:29 +00:00
|
|
|
bool mPreviewWithNotSelected;
|
2015-05-28 16:31:07 +00:00
|
|
|
bool mPreviewFullSelection;
|
2015-05-15 11:47:51 +00:00
|
|
|
|
2015-04-20 00:44:10 +00:00
|
|
|
double mDuration;
|
2019-02-28 18:16:09 +00:00
|
|
|
NumericFormatSymbol mDurationFormat;
|
2015-05-28 16:31:07 +00:00
|
|
|
|
|
|
|
bool mIsPreview;
|
2015-04-20 00:44:10 +00:00
|
|
|
|
2015-04-22 20:55:58 +00:00
|
|
|
bool mUIDebug;
|
|
|
|
|
2016-09-08 15:04:35 +00:00
|
|
|
std::vector<Track*> mIMap;
|
|
|
|
std::vector<Track*> mOMap;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
int mNumTracks; //v This is really mNumWaveTracks, per CountWaveTracks() and GetNumWaveTracks().
|
|
|
|
int mNumGroups;
|
|
|
|
|
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
|
|
|
// For client driver
|
|
|
|
EffectClientInterface *mClient;
|
2016-04-17 04:30:18 +00:00
|
|
|
size_t mNumAudioIn;
|
|
|
|
size_t mNumAudioOut;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t mBufferSize;
|
|
|
|
size_t mBlockSize;
|
2016-09-02 19:53:09 +00:00
|
|
|
unsigned mNumChannels;
|
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
|
|
|
|
2020-01-23 19:48:21 +00:00
|
|
|
public:
|
2015-04-26 21:41:05 +00:00
|
|
|
const static wxString kUserPresetIdent;
|
|
|
|
const static wxString kFactoryPresetIdent;
|
|
|
|
const static wxString kCurrentSettingsIdent;
|
|
|
|
const static wxString kFactoryDefaultsIdent;
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
friend class EffectUIHost;
|
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
|
|
|
};
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// FIXME:
|
2016-02-13 15:43:16 +00:00
|
|
|
// FIXME: Remove this once all effects are using the NEW dialog
|
2015-04-17 03:53:42 +00:00
|
|
|
// FIXME:
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
#define ID_EFFECT_PREVIEW ePreviewID
|
|
|
|
|
|
|
|
// Utility functions
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
inline float TrapFloat(float x, float min, float max)
|
|
|
|
{
|
|
|
|
if (x <= min)
|
|
|
|
return min;
|
|
|
|
|
|
|
|
if (x >= max)
|
|
|
|
return max;
|
|
|
|
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline double TrapDouble(double x, double min, double max)
|
|
|
|
{
|
|
|
|
if (x <= min)
|
|
|
|
return min;
|
|
|
|
|
|
|
|
if (x >= max)
|
|
|
|
return max;
|
|
|
|
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline long TrapLong(long x, long min, long max)
|
|
|
|
{
|
|
|
|
if (x <= min)
|
|
|
|
return min;
|
|
|
|
|
|
|
|
if (x >= max)
|
|
|
|
return max;
|
|
|
|
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Helper macros for defining, reading and verifying effect parameters
|
|
|
|
|
|
|
|
#define Param(name, type, key, def, min, max, scale) \
|
|
|
|
static const wxChar * KEY_ ## name = (key); \
|
|
|
|
static const type DEF_ ## name = (def); \
|
|
|
|
static const type MIN_ ## name = (min); \
|
|
|
|
static const type MAX_ ## name = (max); \
|
|
|
|
static const type SCL_ ## name = (scale);
|
|
|
|
|
|
|
|
#define PBasic(name, type, key, def) \
|
|
|
|
static const wxChar * KEY_ ## name = (key); \
|
|
|
|
static const type DEF_ ## name = (def);
|
|
|
|
|
|
|
|
#define PRange(name, type, key, def, min, max) \
|
|
|
|
PBasic(name, type, key, def); \
|
|
|
|
static const type MIN_ ## name = (min); \
|
|
|
|
static const type MAX_ ## name = (max);
|
|
|
|
|
|
|
|
#define PScale(name, type, key, def, min, max, scale) \
|
|
|
|
PRange(name, type, key, def, min, max); \
|
|
|
|
static const type SCL_ ## name = (scale);
|
|
|
|
|
|
|
|
#define ReadParam(type, name) \
|
2018-02-15 13:56:53 +00:00
|
|
|
type name = DEF_ ## name; \
|
2015-04-17 03:53:42 +00:00
|
|
|
if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, MIN_ ## name, MAX_ ## name)) \
|
|
|
|
return false;
|
|
|
|
|
|
|
|
#define ReadBasic(type, name) \
|
|
|
|
type name; \
|
2016-02-26 19:41:17 +00:00
|
|
|
wxUnusedVar(MIN_ ##name); \
|
|
|
|
wxUnusedVar(MAX_ ##name); \
|
|
|
|
wxUnusedVar(SCL_ ##name); \
|
2015-04-17 03:53:42 +00:00
|
|
|
if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name)) \
|
|
|
|
return false;
|
|
|
|
|
2018-03-27 01:06:35 +00:00
|
|
|
#define ReadAndVerifyEnum(name, list, listSize) \
|
2015-04-17 03:53:42 +00:00
|
|
|
int name; \
|
2018-03-27 01:06:35 +00:00
|
|
|
if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, list, listSize)) \
|
2015-04-17 03:53:42 +00:00
|
|
|
return false;
|
|
|
|
|
2018-03-27 01:06:35 +00:00
|
|
|
#define ReadAndVerifyEnumWithObsoletes(name, list, listSize, obsoleteList, nObsolete) \
|
2018-03-26 14:44:34 +00:00
|
|
|
int name; \
|
|
|
|
if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, \
|
2018-03-27 01:06:35 +00:00
|
|
|
list, listSize, obsoleteList, nObsolete)) \
|
2018-03-26 14:44:34 +00:00
|
|
|
return false;
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
#define ReadAndVerifyInt(name) ReadParam(int, name)
|
|
|
|
#define ReadAndVerifyDouble(name) ReadParam(double, name)
|
|
|
|
#define ReadAndVerifyFloat(name) ReadParam(float, name)
|
|
|
|
#define ReadAndVerifyBool(name) ReadBasic(bool, name)
|
|
|
|
#define ReadAndVerifyString(name) ReadBasic(wxString, name)
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
#endif
|