2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
Effect.cpp
|
|
|
|
|
|
|
|
Dominic Mazzoni
|
|
|
|
Vaughan Johnson
|
|
|
|
Martyn Shaw
|
|
|
|
|
|
|
|
*******************************************************************//**
|
|
|
|
|
|
|
|
\class Effect
|
|
|
|
\brief Base class for many of the effects in Audacity.
|
|
|
|
|
|
|
|
*//****************************************************************//**
|
|
|
|
|
|
|
|
\class EffectDialog
|
2014-06-03 20:30:19 +00:00
|
|
|
\brief New (Jun-2006) base class for effects dialogs. Likely to get
|
2010-01-23 19:44:49 +00:00
|
|
|
greater use in future.
|
|
|
|
|
|
|
|
*//*******************************************************************/
|
|
|
|
|
|
|
|
#include "../Audacity.h"
|
2015-06-18 14:24:36 +00:00
|
|
|
#include "Effect.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-11-11 17:27:44 +00:00
|
|
|
#include "../Experimental.h"
|
|
|
|
|
2016-01-21 15:41:03 +00:00
|
|
|
#include <algorithm>
|
|
|
|
|
2018-11-14 16:07:06 +00:00
|
|
|
#include <wx/choice.h>
|
2010-01-23 19:44:49 +00:00
|
|
|
#include <wx/defs.h>
|
2018-11-14 21:30:11 +00:00
|
|
|
#include <wx/listbox.h>
|
2010-01-23 19:44:49 +00:00
|
|
|
#include <wx/sizer.h>
|
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
|
|
|
#include "../AudioIO.h"
|
2016-02-27 19:24:57 +00:00
|
|
|
#include "../LabelTrack.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
#include "../Mix.h"
|
2019-01-22 11:57:30 +00:00
|
|
|
#include "../PluginManager.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
#include "../Project.h"
|
2019-06-09 12:39:18 +00:00
|
|
|
#include "../ProjectAudioManager.h"
|
2019-05-29 15:31:40 +00:00
|
|
|
#include "../ProjectSettings.h"
|
2015-06-18 14:24:36 +00:00
|
|
|
#include "../ShuttleGui.h"
|
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
|
|
|
#include "../Shuttle.h"
|
2019-04-28 10:49:47 +00:00
|
|
|
#include "../ViewInfo.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
#include "../WaveTrack.h"
|
|
|
|
#include "../widgets/ProgressDialog.h"
|
|
|
|
#include "../ondemand/ODManager.h"
|
2019-07-09 14:29:29 +00:00
|
|
|
#include "../tracks/playabletrack/wavetrack/ui/WaveTrackView.h"
|
|
|
|
#include "../tracks/playabletrack/wavetrack/ui/WaveTrackViewConstants.h"
|
2017-10-06 15:05:15 +00:00
|
|
|
#include "../widgets/NumericTextCtrl.h"
|
2019-05-20 18:27:11 +00:00
|
|
|
#include "../widgets/AudacityMessageBox.h"
|
2017-05-20 16:11:02 +00:00
|
|
|
#include "../widgets/ErrorDialog.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-01-08 21:38:52 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
|
2018-02-24 10:31:50 +00:00
|
|
|
// Effect application counter
|
|
|
|
int Effect::nEffectsDone=0;
|
|
|
|
|
2015-07-18 04:18:55 +00:00
|
|
|
static const int kPlayID = 20102;
|
|
|
|
static const int kRewindID = 20103;
|
|
|
|
static const int kFFwdID = 20104;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-26 21:41:05 +00:00
|
|
|
const wxString Effect::kUserPresetIdent = wxT("User Preset:");
|
|
|
|
const wxString Effect::kFactoryPresetIdent = wxT("Factory Preset:");
|
|
|
|
const wxString Effect::kCurrentSettingsIdent = wxT("<Current Settings>");
|
|
|
|
const wxString Effect::kFactoryDefaultsIdent = wxT("<Factory Defaults>");
|
|
|
|
|
2018-01-08 21:38:52 +00:00
|
|
|
using t2bHash = std::unordered_map< void*, bool >;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-05-11 22:49:02 +00:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
Effect::VetoDialogHook &GetVetoDialogHook()
|
|
|
|
{
|
|
|
|
static Effect::VetoDialogHook sHook = nullptr;
|
|
|
|
return sHook;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Effect::SetVetoDialogHook( VetoDialogHook hook )
|
|
|
|
-> VetoDialogHook
|
|
|
|
{
|
|
|
|
auto &theHook = GetVetoDialogHook();
|
|
|
|
auto result = theHook;
|
|
|
|
theHook = hook;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
Effect::Effect()
|
|
|
|
{
|
2014-11-05 20:41:29 +00:00
|
|
|
mClient = NULL;
|
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-11-05 20:41:29 +00:00
|
|
|
mTracks = NULL;
|
2015-05-13 04:19:56 +00:00
|
|
|
mT0 = 0.0;
|
|
|
|
mT1 = 0.0;
|
2014-11-07 09:54:04 +00:00
|
|
|
mDuration = 0.0;
|
2015-05-28 16:31:07 +00:00
|
|
|
mIsPreview = false;
|
2015-05-15 11:47:51 +00:00
|
|
|
mIsLinearEffect = false;
|
2015-05-15 15:57:29 +00:00
|
|
|
mPreviewWithNotSelected = false;
|
2015-05-28 16:31:07 +00:00
|
|
|
mPreviewFullSelection = false;
|
2014-11-05 20:41:29 +00:00
|
|
|
mNumTracks = 0;
|
|
|
|
mNumGroups = 0;
|
|
|
|
mProgress = NULL;
|
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
|
|
|
mUIParent = NULL;
|
|
|
|
mUIDialog = NULL;
|
2014-11-05 20:41:29 +00:00
|
|
|
|
|
|
|
mNumAudioIn = 0;
|
|
|
|
mNumAudioOut = 0;
|
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
|
|
|
|
|
|
|
mBufferSize = 0;
|
|
|
|
mBlockSize = 0;
|
|
|
|
mNumChannels = 0;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2015-04-22 20:55:58 +00:00
|
|
|
mUIDebug = false;
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
AudacityProject *p = GetActiveProject();
|
2019-05-27 14:17:16 +00:00
|
|
|
mProjectRate = p ? ProjectSettings::Get( *p ).GetRate() : 44100;
|
2015-04-26 21:41:05 +00:00
|
|
|
mIsBatch = false;
|
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::~Effect()
|
|
|
|
{
|
2015-04-26 21:41:05 +00:00
|
|
|
if (mUIDialog)
|
|
|
|
{
|
|
|
|
mUIDialog->Close();
|
|
|
|
}
|
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
|
|
|
|
|
|
|
EffectType Effect::GetType()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetType();
|
|
|
|
}
|
|
|
|
|
|
|
|
return EffectTypeNone;
|
|
|
|
}
|
|
|
|
|
2019-02-28 00:58:02 +00:00
|
|
|
PluginPath Effect::GetPath()
|
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
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetPath();
|
|
|
|
}
|
|
|
|
|
2018-03-09 18:11:20 +00:00
|
|
|
return BUILTIN_EFFECT_PREFIX + GetSymbol().Internal();
|
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
|
|
|
}
|
|
|
|
|
2018-11-02 15:31:44 +00:00
|
|
|
ComponentInterfaceSymbol Effect::GetSymbol()
|
2014-12-15 21:54:23 +00:00
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetSymbol();
|
|
|
|
}
|
|
|
|
|
2018-03-09 18:11:20 +00:00
|
|
|
return {};
|
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 18:16:09 +00:00
|
|
|
VendorSymbol Effect::GetVendor()
|
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
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetVendor();
|
|
|
|
}
|
|
|
|
|
2015-06-05 23:56:24 +00:00
|
|
|
return XO("Audacity");
|
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
|
|
|
}
|
|
|
|
|
|
|
|
wxString Effect::GetVersion()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetVersion();
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
return AUDACITY_VERSION_STRING;
|
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-12-08 18:53:48 +00:00
|
|
|
TranslatableString Effect::GetDescription()
|
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
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetDescription();
|
|
|
|
}
|
|
|
|
|
2019-12-08 18:53:48 +00:00
|
|
|
return {};
|
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 18:16:09 +00:00
|
|
|
EffectFamilySymbol Effect::GetFamily()
|
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
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
2019-02-28 18:16:09 +00:00
|
|
|
return mClient->GetFamily();
|
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
|
|
|
}
|
|
|
|
|
2018-03-29 16:28:35 +00:00
|
|
|
// Unusually, the internal and visible strings differ for the built-in
|
|
|
|
// effect family.
|
|
|
|
return { wxT("Audacity"), XO("Built-in") };
|
2018-01-16 04:40:42 +00:00
|
|
|
}
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
bool Effect::IsInteractive()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->IsInteractive();
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
return true;
|
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
|
|
|
bool Effect::IsDefault()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->IsDefault();
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
return true;
|
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-09-05 20:01:46 +00:00
|
|
|
bool Effect::IsLegacy()
|
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
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
bool Effect::SupportsRealtime()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->SupportsRealtime();
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
bool Effect::SupportsAutomation()
|
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
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
2014-11-14 03:03:17 +00:00
|
|
|
return mClient->SupportsAutomation();
|
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
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// EffectClientInterface implementation
|
|
|
|
|
|
|
|
bool Effect::SetHost(EffectHostInterface *host)
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->SetHost(host);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-09-02 19:53:09 +00:00
|
|
|
unsigned Effect::GetAudioInCount()
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetAudioInCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-09-02 19:53:09 +00:00
|
|
|
unsigned Effect::GetAudioOutCount()
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetAudioOutCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Effect::GetMidiInCount()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetMidiInCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Effect::GetMidiOutCount()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetMidiOutCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-08-20 22:10:36 +00:00
|
|
|
void Effect::SetSampleRate(double rate)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
mClient->SetSampleRate(rate);
|
|
|
|
}
|
|
|
|
|
|
|
|
mSampleRate = rate;
|
|
|
|
}
|
|
|
|
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t Effect::SetBlockSize(size_t maxBlockSize)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->SetBlockSize(maxBlockSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
mBlockSize = maxBlockSize;
|
|
|
|
|
|
|
|
return mBlockSize;
|
|
|
|
}
|
|
|
|
|
2019-06-23 23:19:32 +00:00
|
|
|
size_t Effect::GetBlockSize() const
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetBlockSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
return mBlockSize;
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
sampleCount Effect::GetLatency()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetLatency();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t Effect::GetTailSize()
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetTailSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::IsReady()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->IsReady();
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::ProcessInitialize(sampleCount totalLen, ChannelNames chanMap)
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->ProcessInitialize(totalLen, chanMap);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::ProcessFinalize()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->ProcessFinalize();
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t Effect::ProcessBlock(float **inBlock, float **outBlock, size_t blockLen)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->ProcessBlock(inBlock, outBlock, blockLen);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::RealtimeInitialize()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
mBlockSize = mClient->SetBlockSize(512);
|
|
|
|
return mClient->RealtimeInitialize();
|
|
|
|
}
|
|
|
|
|
2015-08-01 12:03:02 +00:00
|
|
|
mBlockSize = 512;
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-09-02 19:53:09 +00:00
|
|
|
bool Effect::RealtimeAddProcessor(unsigned numChannels, float sampleRate)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->RealtimeAddProcessor(numChannels, sampleRate);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::RealtimeFinalize()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->RealtimeFinalize();
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-06-23 23:23:18 +00:00
|
|
|
bool Effect::RealtimeSuspend()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
return mClient->RealtimeSuspend();
|
2015-08-01 12:03:02 +00:00
|
|
|
|
|
|
|
return true;
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
|
|
|
|
2019-06-23 23:23:18 +00:00
|
|
|
bool Effect::RealtimeResume()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
return mClient->RealtimeResume();
|
2015-08-01 12:03:02 +00:00
|
|
|
|
|
|
|
return true;
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::RealtimeProcessStart()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->RealtimeProcessStart();
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t Effect::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)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->RealtimeProcess(group, inbuf, outbuf, numSamples);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::RealtimeProcessEnd()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->RealtimeProcessEnd();
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:09:18 +00:00
|
|
|
bool Effect::ShowInterface(wxWindow &parent,
|
2019-07-21 16:13:47 +00:00
|
|
|
const EffectDialogFactory &factory, bool forceModal)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
2015-04-26 21:41:05 +00:00
|
|
|
if (!IsInteractive())
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mUIDialog)
|
|
|
|
{
|
2016-12-16 20:32:56 +00:00
|
|
|
if ( mUIDialog->Close(true) )
|
|
|
|
mUIDialog = nullptr;
|
2015-04-26 21:41:05 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
if (mClient)
|
|
|
|
{
|
2019-07-21 16:13:47 +00:00
|
|
|
return mClient->ShowInterface(parent, factory, forceModal);
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
|
|
|
|
2016-12-16 20:32:56 +00:00
|
|
|
// mUIDialog is null
|
|
|
|
auto cleanup = valueRestorer( mUIDialog );
|
2019-07-21 16:13:47 +00:00
|
|
|
|
|
|
|
if ( factory )
|
|
|
|
mUIDialog = factory(parent, this, this);
|
2015-04-17 03:53:42 +00:00
|
|
|
if (!mUIDialog)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-06-02 22:52:53 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
mUIDialog->Layout();
|
|
|
|
mUIDialog->Fit();
|
|
|
|
mUIDialog->SetMinSize(mUIDialog->GetSize());
|
|
|
|
|
2019-05-11 22:49:02 +00:00
|
|
|
auto hook = GetVetoDialogHook();
|
|
|
|
if( hook && hook( mUIDialog ) )
|
2017-06-04 15:52:17 +00:00
|
|
|
return false;
|
2017-06-02 22:52:53 +00:00
|
|
|
|
|
|
|
if( SupportsRealtime() && !forceModal )
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
mUIDialog->Show();
|
2016-12-16 20:32:56 +00:00
|
|
|
cleanup.release();
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2015-04-26 21:41:05 +00:00
|
|
|
// Return false to bypass effect processing
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool res = mUIDialog->ShowModal() != 0;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2018-02-21 14:24:25 +00:00
|
|
|
bool Effect::GetAutomationParameters(CommandParameters & parms)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetAutomationParameters(parms);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-02-21 14:24:25 +00:00
|
|
|
bool Effect::SetAutomationParameters(CommandParameters & parms)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->SetAutomationParameters(parms);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::LoadUserPreset(const RegistryPath & name)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
2015-04-23 13:17:33 +00:00
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->LoadUserPreset(name);
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
wxString parms;
|
|
|
|
if (!GetPrivateConfig(name, wxT("Parameters"), parms))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return SetAutomationParameters(parms);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::SaveUserPreset(const RegistryPath & name)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
2015-04-23 13:17:33 +00:00
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->SaveUserPreset(name);
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
wxString parms;
|
|
|
|
if (!GetAutomationParameters(parms))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return SetPrivateConfig(name, wxT("Parameters"), parms);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
RegistryPaths Effect::GetFactoryPresets()
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
2015-04-23 13:04:32 +00:00
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetFactoryPresets();
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
return {};
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
|
|
|
|
2015-04-23 13:04:32 +00:00
|
|
|
bool Effect::LoadFactoryPreset(int id)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
2015-04-23 13:04:32 +00:00
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->LoadFactoryPreset(id);
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::LoadFactoryDefaults()
|
|
|
|
{
|
2015-04-23 13:04:32 +00:00
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->LoadFactoryDefaults();
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
return LoadUserPreset(GetFactoryDefaultsGroup());
|
|
|
|
}
|
|
|
|
|
|
|
|
// EffectUIClientInterface implementation
|
|
|
|
|
|
|
|
void Effect::SetHostUI(EffectUIHostInterface *WXUNUSED(host))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::PopulateUI(wxWindow *parent)
|
|
|
|
{
|
|
|
|
mUIParent = parent;
|
|
|
|
mUIParent->PushEventHandler(this);
|
|
|
|
|
2015-04-26 21:41:05 +00:00
|
|
|
// LoadUserPreset(GetCurrentSettingsGroup());
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
ShuttleGui S(mUIParent, eIsCreating);
|
|
|
|
PopulateOrExchange(S);
|
|
|
|
|
|
|
|
mUIParent->SetMinSize(mUIParent->GetSizer()->GetMinSize());
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::IsGraphicalUI()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::ValidateUI()
|
|
|
|
{
|
|
|
|
return mUIParent->Validate();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::HideUI()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::CloseUI()
|
|
|
|
{
|
2016-12-22 14:38:11 +00:00
|
|
|
if (mUIParent)
|
|
|
|
mUIParent->RemoveEventHandler(this);
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
mUIParent = NULL;
|
2015-08-01 12:03:02 +00:00
|
|
|
mUIDialog = NULL;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::CanExportPresets()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Effect::ExportPresets()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Effect::ImportPresets()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::HasOptions()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Effect::ShowOptions()
|
|
|
|
{
|
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
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
double Effect::GetDefaultDuration()
|
|
|
|
{
|
|
|
|
return 30.0;
|
|
|
|
}
|
|
|
|
|
2015-05-27 13:42:15 +00:00
|
|
|
double Effect::GetDuration()
|
2014-11-07 09:54:04 +00:00
|
|
|
{
|
2015-04-20 00:44:10 +00:00
|
|
|
if (mDuration < 0.0)
|
|
|
|
{
|
|
|
|
mDuration = 0.0;
|
2014-11-07 09:54:04 +00:00
|
|
|
}
|
|
|
|
|
2015-04-20 00:44:10 +00:00
|
|
|
return mDuration;
|
2014-11-07 09:54:04 +00:00
|
|
|
}
|
|
|
|
|
2019-02-28 18:16:09 +00:00
|
|
|
NumericFormatSymbol Effect::GetDurationFormat()
|
2015-05-27 13:42:15 +00:00
|
|
|
{
|
|
|
|
return mDurationFormat;
|
|
|
|
}
|
|
|
|
|
2019-02-28 18:16:09 +00:00
|
|
|
NumericFormatSymbol Effect::GetSelectionFormat()
|
2015-07-18 17:31:36 +00:00
|
|
|
{
|
2020-01-06 18:48:51 +00:00
|
|
|
return ProjectSettings::Get( *GetActiveProject() ).GetSelectionFormat();
|
2015-07-18 17:31:36 +00:00
|
|
|
}
|
|
|
|
|
2015-04-20 00:44:10 +00:00
|
|
|
void Effect::SetDuration(double seconds)
|
2014-11-07 09:54:04 +00:00
|
|
|
{
|
2015-04-20 00:44:10 +00:00
|
|
|
if (seconds < 0.0)
|
|
|
|
{
|
|
|
|
seconds = 0.0;
|
|
|
|
}
|
|
|
|
|
2015-05-27 13:42:15 +00:00
|
|
|
if (GetType() == EffectTypeGenerate)
|
2015-04-20 00:44:10 +00:00
|
|
|
{
|
|
|
|
SetPrivateConfig(GetCurrentSettingsGroup(), wxT("LastUsedDuration"), seconds);
|
|
|
|
}
|
|
|
|
|
2014-11-07 09:54:04 +00:00
|
|
|
mDuration = seconds;
|
|
|
|
|
2015-05-27 13:42:15 +00:00
|
|
|
mIsSelection = false;
|
|
|
|
|
2015-04-20 00:44:10 +00:00
|
|
|
return;
|
2014-11-07 09:54:04 +00:00
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
RegistryPath Effect::GetUserPresetsGroup(const RegistryPath & name)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2019-03-01 17:20:51 +00:00
|
|
|
RegistryPath group = wxT("UserPresets");
|
2019-02-12 00:10:48 +00:00
|
|
|
if (!name.empty())
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
|
|
|
group += wxCONFIG_PATH_SEPARATOR + name;
|
|
|
|
}
|
|
|
|
|
|
|
|
return group;
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
RegistryPath Effect::GetCurrentSettingsGroup()
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
|
|
|
return wxT("CurrentSettings");
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
RegistryPath Effect::GetFactoryDefaultsGroup()
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
|
|
|
return wxT("FactoryDefaults");
|
|
|
|
}
|
|
|
|
|
2015-04-27 14:22:47 +00:00
|
|
|
wxString Effect::GetSavedStateGroup()
|
|
|
|
{
|
|
|
|
return wxT("SavedState");
|
|
|
|
}
|
|
|
|
|
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 Effect::HasSharedConfigGroup(const RegistryPath & group)
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
return PluginManager::Get().HasSharedConfigGroup(GetID(), group);
|
|
|
|
}
|
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
|
|
|
bool Effect::GetSharedConfigSubgroups(const RegistryPath & group, RegistryPaths &subgroups)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfigSubgroups(GetID(), group, subgroups);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::GetSharedConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::GetSharedConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::GetSharedConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::GetSharedConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::GetSharedConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const int & value)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const bool & value)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const float & value)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const double & value)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::RemoveSharedConfigSubgroup(const RegistryPath & group)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
|
|
|
return PluginManager::Get().RemoveSharedConfigSubgroup(GetID(), group);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::RemoveSharedConfig(const RegistryPath & group, const RegistryPath & key)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
|
|
|
return PluginManager::Get().RemoveSharedConfig(GetID(), group, key);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::HasPrivateConfigGroup(const RegistryPath & group)
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
return PluginManager::Get().HasPrivateConfigGroup(GetID(), group);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::GetPrivateConfigSubgroups(const RegistryPath & group, RegistryPaths & subgroups)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfigSubgroups(GetID(), group, subgroups);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const int & value)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const bool & value)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const float & value)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const double & value)
|
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
|
|
|
{
|
|
|
|
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::RemovePrivateConfigSubgroup(const RegistryPath & group)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
|
|
|
return PluginManager::Get().RemovePrivateConfigSubgroup(GetID(), group);
|
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
bool Effect::RemovePrivateConfig(const RegistryPath & group, const RegistryPath & key)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
|
|
|
return PluginManager::Get().RemovePrivateConfig(GetID(), group, key);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
2015-01-19 16:28:48 +00:00
|
|
|
PluginID Effect::GetID()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return PluginManager::GetID(mClient);
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
return PluginManager::GetID(this);
|
2015-01-19 16:28:48 +00:00
|
|
|
}
|
|
|
|
|
2014-11-05 20:41:29 +00:00
|
|
|
bool Effect::Startup(EffectClientInterface *client)
|
|
|
|
{
|
2014-11-07 09:54:04 +00:00
|
|
|
// Let destructor know we need to be shutdown
|
|
|
|
mClient = client;
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
// Set host so client startup can use our services
|
2015-04-17 03:53:42 +00:00
|
|
|
if (!SetHost(this))
|
2014-11-05 20:41:29 +00:00
|
|
|
{
|
2014-11-14 03:03:17 +00:00
|
|
|
// Bail if the client startup fails
|
2014-11-07 09:54:04 +00:00
|
|
|
mClient = NULL;
|
2014-11-05 20:41:29 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
mNumAudioIn = GetAudioInCount();
|
|
|
|
mNumAudioOut = GetAudioOutCount();
|
2014-11-05 20:41:29 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
bool haveDefaults;
|
|
|
|
GetPrivateConfig(GetFactoryDefaultsGroup(), wxT("Initialized"), haveDefaults, false);
|
|
|
|
if (!haveDefaults)
|
2014-11-05 20:41:29 +00:00
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
SaveUserPreset(GetFactoryDefaultsGroup());
|
|
|
|
SetPrivateConfig(GetFactoryDefaultsGroup(), wxT("Initialized"), true);
|
2014-11-05 20:41:29 +00:00
|
|
|
}
|
2015-04-17 03:53:42 +00:00
|
|
|
LoadUserPreset(GetCurrentSettingsGroup());
|
2014-11-05 20:41:29 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
return Startup();
|
2014-11-05 20:41:29 +00:00
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
bool Effect::Startup()
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
bool Effect::GetAutomationParameters(wxString & parms)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2018-02-21 14:24:25 +00:00
|
|
|
CommandParameters eap;
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
if (mUIDialog && !TransferDataFromWindow())
|
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
|
|
|
return false;
|
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
|
|
|
ShuttleGetAutomation S;
|
|
|
|
S.mpEap = &eap;
|
|
|
|
if( DefineParams( S ) ){
|
|
|
|
;// got eap value using DefineParams.
|
|
|
|
}
|
|
|
|
// Won't be needed in future
|
|
|
|
else if (!GetAutomationParameters(eap))
|
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
|
|
|
return false;
|
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
|
|
|
return eap.GetParameters(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
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
bool Effect::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
|
|
|
{
|
2015-04-26 21:41:05 +00:00
|
|
|
wxString preset = parms;
|
|
|
|
bool success = false;
|
|
|
|
if (preset.StartsWith(kUserPresetIdent))
|
|
|
|
{
|
|
|
|
preset.Replace(kUserPresetIdent, wxEmptyString, false);
|
|
|
|
success = LoadUserPreset(GetUserPresetsGroup(preset));
|
|
|
|
}
|
|
|
|
else if (preset.StartsWith(kFactoryPresetIdent))
|
|
|
|
{
|
|
|
|
preset.Replace(kFactoryPresetIdent, wxEmptyString, false);
|
2019-02-12 19:00:23 +00:00
|
|
|
auto presets = GetFactoryPresets();
|
2019-03-04 07:13:40 +00:00
|
|
|
success = LoadFactoryPreset( make_iterator_range( presets ).index( preset ) );
|
2015-04-26 21:41:05 +00:00
|
|
|
}
|
|
|
|
else if (preset.StartsWith(kCurrentSettingsIdent))
|
|
|
|
{
|
|
|
|
preset.Replace(kCurrentSettingsIdent, wxEmptyString, false);
|
|
|
|
success = LoadUserPreset(GetCurrentSettingsGroup());
|
|
|
|
}
|
|
|
|
else if (preset.StartsWith(kFactoryDefaultsIdent))
|
|
|
|
{
|
|
|
|
preset.Replace(kFactoryDefaultsIdent, wxEmptyString, false);
|
|
|
|
success = LoadUserPreset(GetFactoryDefaultsGroup());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-02-21 14:24:25 +00:00
|
|
|
CommandParameters eap(parms);
|
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
|
|
|
ShuttleSetAutomation S;
|
|
|
|
S.SetForValidating( &eap );
|
|
|
|
// DefineParams returns false if not defined for this effect.
|
|
|
|
if( !DefineParams( S ) )
|
|
|
|
// the old method...
|
|
|
|
success = SetAutomationParameters(eap);
|
|
|
|
else if( !S.bOK )
|
|
|
|
success = false;
|
|
|
|
else{
|
|
|
|
success = true;
|
|
|
|
S.SetForWriting( &eap );
|
|
|
|
DefineParams( S );
|
|
|
|
}
|
2015-04-26 21:41:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!success)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
2017-09-07 03:35:54 +00:00
|
|
|
Effect::MessageBox(
|
2019-12-19 19:19:51 +00:00
|
|
|
XO("%s: Could not load settings below. Default settings will be used.\n\n%s")
|
|
|
|
.Format( GetName(), preset ) );
|
2018-02-24 10:31:50 +00:00
|
|
|
// We are using defualt settings and we still wish to continue.
|
|
|
|
return true;
|
|
|
|
//return false;
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!mUIDialog)
|
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
|
|
|
return true;
|
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
|
|
|
return TransferDataToWindow();
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
2019-03-01 17:20:51 +00:00
|
|
|
RegistryPaths Effect::GetUserPresets()
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
2019-03-01 17:20:51 +00:00
|
|
|
RegistryPaths presets;
|
2019-09-05 20:01:46 +00:00
|
|
|
|
2015-04-26 21:41:05 +00:00
|
|
|
GetPrivateConfigSubgroups(GetUserPresetsGroup(wxEmptyString), presets);
|
|
|
|
|
2019-02-12 00:10:48 +00:00
|
|
|
std::sort( presets.begin(), presets.end() );
|
2015-04-26 21:41:05 +00:00
|
|
|
|
|
|
|
return presets;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::HasCurrentSettings()
|
|
|
|
{
|
|
|
|
return HasPrivateConfigGroup(GetCurrentSettingsGroup());
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::HasFactoryDefaults()
|
|
|
|
{
|
|
|
|
return HasPrivateConfigGroup(GetFactoryDefaultsGroup());
|
|
|
|
}
|
|
|
|
|
2015-04-27 10:02:56 +00:00
|
|
|
wxString Effect::GetPreset(wxWindow * parent, const wxString & parms)
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
EffectPresetsDialog dlg(parent, this);
|
|
|
|
dlg.Layout();
|
|
|
|
dlg.Fit();
|
|
|
|
dlg.SetSize(dlg.GetMinSize());
|
2015-04-28 02:14:47 +00:00
|
|
|
dlg.CenterOnParent();
|
2015-04-27 10:02:56 +00:00
|
|
|
dlg.SetSelected(parms);
|
2015-04-26 21:41:05 +00:00
|
|
|
|
|
|
|
if (dlg.ShowModal())
|
|
|
|
{
|
|
|
|
return dlg.GetSelected();
|
|
|
|
}
|
|
|
|
|
|
|
|
return wxEmptyString;
|
|
|
|
}
|
|
|
|
|
2017-05-19 17:20:05 +00:00
|
|
|
wxString Effect::ManualPage()
|
|
|
|
{
|
|
|
|
return wxEmptyString;
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString Effect::HelpPage()
|
2017-05-15 21:00:33 +00:00
|
|
|
{
|
|
|
|
return wxEmptyString;
|
|
|
|
}
|
|
|
|
|
2015-04-26 21:41:05 +00:00
|
|
|
bool Effect::IsBatchProcessing()
|
|
|
|
{
|
|
|
|
return mIsBatch;
|
|
|
|
}
|
|
|
|
|
2015-04-27 14:22:47 +00:00
|
|
|
void Effect::SetBatchProcessing(bool start)
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
2015-04-27 14:22:47 +00:00
|
|
|
mIsBatch = start;
|
|
|
|
|
|
|
|
if (start)
|
|
|
|
{
|
|
|
|
SaveUserPreset(GetSavedStateGroup());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
LoadUserPreset(GetSavedStateGroup());
|
|
|
|
}
|
2015-04-26 21:41:05 +00:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:09:18 +00:00
|
|
|
bool Effect::DoEffect(wxWindow &parent,
|
2010-01-23 19:44:49 +00:00
|
|
|
double projectRate,
|
|
|
|
TrackList *list,
|
|
|
|
TrackFactory *factory,
|
2018-02-16 23:07:59 +00:00
|
|
|
NotifyingSelectedRegion &selectedRegion,
|
2019-07-21 16:13:47 +00:00
|
|
|
const EffectDialogFactory &dialogFactory)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2018-02-16 23:07:59 +00:00
|
|
|
wxASSERT(selectedRegion.duration() >= 0.0);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-08-13 13:26:53 +00:00
|
|
|
mOutputTracks.reset();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-02-16 23:07:59 +00:00
|
|
|
mpSelectedRegion = &selectedRegion;
|
2010-01-23 19:44:49 +00:00
|
|
|
mFactory = factory;
|
|
|
|
mProjectRate = projectRate;
|
|
|
|
mTracks = list;
|
2018-08-21 12:11:41 +00:00
|
|
|
|
|
|
|
// Update track/group counts
|
|
|
|
CountWaveTracks();
|
|
|
|
|
2015-05-27 13:42:15 +00:00
|
|
|
bool isSelection = false;
|
|
|
|
|
|
|
|
mDuration = 0.0;
|
|
|
|
if (GetType() == EffectTypeGenerate)
|
|
|
|
{
|
|
|
|
GetPrivateConfig(GetCurrentSettingsGroup(), wxT("LastUsedDuration"), mDuration, GetDefaultDuration());
|
|
|
|
}
|
|
|
|
|
2018-08-21 12:11:41 +00:00
|
|
|
WaveTrack *newTrack{};
|
|
|
|
bool success = false;
|
|
|
|
auto oldDuration = mDuration;
|
|
|
|
|
|
|
|
auto cleanup = finally( [&] {
|
|
|
|
if (!success) {
|
|
|
|
if (newTrack) {
|
|
|
|
mTracks->Remove(newTrack);
|
|
|
|
}
|
|
|
|
// LastUsedDuration may have been modified by Preview.
|
|
|
|
SetDuration(oldDuration);
|
|
|
|
}
|
|
|
|
|
|
|
|
End();
|
|
|
|
ReplaceProcessedTracks( false );
|
|
|
|
} );
|
|
|
|
|
2018-11-28 18:52:05 +00:00
|
|
|
// We don't yet know the effect type for code in the Nyquist Prompt, so
|
|
|
|
// assume it requires a track and handle errors when the effect runs.
|
|
|
|
if ((GetType() == EffectTypeGenerate || GetPath() == NYQUIST_PROMPT_ID) && (mNumTracks == 0)) {
|
2018-11-19 04:07:05 +00:00
|
|
|
newTrack = mTracks->Add(mFactory->NewWaveTrack());
|
2018-08-21 12:11:41 +00:00
|
|
|
newTrack->SetSelected(true);
|
|
|
|
}
|
|
|
|
|
2018-02-16 23:07:59 +00:00
|
|
|
mT0 = selectedRegion.t0();
|
|
|
|
mT1 = selectedRegion.t1();
|
2015-05-27 13:42:15 +00:00
|
|
|
if (mT1 > mT0)
|
|
|
|
{
|
|
|
|
// there is a selection: let's fit in there...
|
|
|
|
// MJS: note that this is just for the TTC and is independent of the track rate
|
|
|
|
// but we do need to make sure we have the right number of samples at the project rate
|
|
|
|
double quantMT0 = QUANTIZED_TIME(mT0, mProjectRate);
|
|
|
|
double quantMT1 = QUANTIZED_TIME(mT1, mProjectRate);
|
|
|
|
mDuration = quantMT1 - quantMT0;
|
|
|
|
isSelection = true;
|
2018-11-28 18:52:05 +00:00
|
|
|
mT1 = mT0 + mDuration;
|
2015-05-27 13:42:15 +00:00
|
|
|
}
|
|
|
|
|
2017-10-06 15:05:15 +00:00
|
|
|
mDurationFormat = isSelection
|
|
|
|
? NumericConverter::TimeAndSampleFormat()
|
|
|
|
: NumericConverter::DefaultSelectionFormat();
|
2015-05-27 13:42:15 +00:00
|
|
|
|
2014-10-18 14:19:38 +00:00
|
|
|
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
|
2018-02-16 23:07:59 +00:00
|
|
|
mF0 = selectedRegion.f0();
|
|
|
|
mF1 = selectedRegion.f1();
|
2014-10-24 20:27:04 +00:00
|
|
|
wxArrayString Names;
|
|
|
|
if( mF0 != SelectedRegion::UndefinedFrequency )
|
2019-02-12 00:10:48 +00:00
|
|
|
Names.push_back(wxT("control-f0"));
|
2014-10-24 20:27:04 +00:00
|
|
|
if( mF1 != SelectedRegion::UndefinedFrequency )
|
2019-02-12 00:10:48 +00:00
|
|
|
Names.push_back(wxT("control-f1"));
|
2014-10-24 20:27:04 +00:00
|
|
|
SetPresetParameters( &Names, NULL );
|
|
|
|
|
2014-10-18 14:19:38 +00:00
|
|
|
#endif
|
2010-01-23 19:44:49 +00:00
|
|
|
CountWaveTracks();
|
|
|
|
|
|
|
|
// Note: Init may read parameters from preferences
|
|
|
|
if (!Init())
|
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
|
|
|
return false;
|
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
|
|
|
|
2019-09-05 20:01:46 +00:00
|
|
|
// Prompting will be bypassed when applying an effect that has already
|
2015-04-17 03:53:42 +00:00
|
|
|
// been configured, e.g. repeating the last effect on a different selection.
|
2016-12-16 18:27:24 +00:00
|
|
|
// Prompting may call Effect::Preview
|
2019-07-21 16:13:47 +00:00
|
|
|
if ( dialogFactory &&
|
2019-07-24 19:08:59 +00:00
|
|
|
IsInteractive() &&
|
2019-07-21 16:13:47 +00:00
|
|
|
!ShowInterface(parent, dialogFactory, IsBatchProcessing()) )
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
return false;
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool returnVal = true;
|
|
|
|
bool skipFlag = CheckWhetherSkipEffect();
|
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
|
|
|
if (skipFlag == false)
|
|
|
|
{
|
2019-12-19 16:44:00 +00:00
|
|
|
auto name = GetName();
|
2016-12-16 18:27:24 +00:00
|
|
|
ProgressDialog progress{
|
2017-09-07 03:35:54 +00:00
|
|
|
name,
|
2019-12-08 03:37:02 +00:00
|
|
|
XO("Applying %s...").Format( name ),
|
2016-12-16 18:27:24 +00:00
|
|
|
pdlgHideStopButton
|
|
|
|
};
|
|
|
|
auto vr = valueRestorer( mProgress, &progress );
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
returnVal = Process();
|
|
|
|
}
|
|
|
|
|
2018-02-24 10:31:50 +00:00
|
|
|
if (returnVal && (mT1 >= mT0 ))
|
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
|
|
|
{
|
2018-02-16 23:07:59 +00:00
|
|
|
selectedRegion.setTimes(mT0, mT1);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2018-08-21 12:11:41 +00:00
|
|
|
success = returnVal;
|
2010-01-23 19:44:49 +00:00
|
|
|
return returnVal;
|
|
|
|
}
|
|
|
|
|
2019-07-21 16:13:47 +00:00
|
|
|
bool Effect::Delegate(
|
2020-01-06 15:09:18 +00:00
|
|
|
Effect &delegate, wxWindow &parent, const EffectDialogFactory &factory )
|
2016-12-29 15:36:37 +00:00
|
|
|
{
|
2018-02-16 23:07:59 +00:00
|
|
|
NotifyingSelectedRegion region;
|
|
|
|
region.setTimes( mT0, mT1 );
|
2019-04-22 14:57:14 +00:00
|
|
|
|
2016-12-29 15:36:37 +00:00
|
|
|
return delegate.DoEffect( parent, mProjectRate, mTracks, mFactory,
|
2019-07-21 16:13:47 +00:00
|
|
|
region, factory );
|
2016-12-29 15:36:37 +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
|
|
|
// All legacy effects should have this overridden
|
|
|
|
bool Effect::Init()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
int Effect::GetPass()
|
|
|
|
{
|
|
|
|
return mPass;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::InitPass1()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::InitPass2()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
bool Effect::Process()
|
|
|
|
{
|
2016-12-31 09:54:52 +00:00
|
|
|
CopyInputTracks(true);
|
2015-04-17 03:53:42 +00:00
|
|
|
bool bGoodResult = true;
|
|
|
|
|
2015-08-16 05:15:55 +00:00
|
|
|
// It's possible that the number of channels the effect expects changed based on
|
|
|
|
// the parameters (the Audacity Reverb effect does when the stereo width is 0).
|
|
|
|
mNumAudioIn = GetAudioInCount();
|
|
|
|
mNumAudioOut = GetAudioOutCount();
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
mPass = 1;
|
|
|
|
if (InitPass1())
|
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
|
|
|
bGoodResult = ProcessPass();
|
|
|
|
mPass = 2;
|
|
|
|
if (bGoodResult && InitPass2())
|
|
|
|
{
|
|
|
|
bGoodResult = ProcessPass();
|
|
|
|
}
|
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-09-05 20:01:46 +00:00
|
|
|
ReplaceProcessedTracks(bGoodResult);
|
2014-11-07 09:54:04 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
return bGoodResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::ProcessPass()
|
|
|
|
{
|
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
|
|
|
bool bGoodResult = true;
|
2015-04-17 03:53:42 +00:00
|
|
|
bool isGenerator = GetType() == EffectTypeGenerate;
|
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-12-16 18:27:24 +00:00
|
|
|
FloatBuffers inBuffer, outBuffer;
|
|
|
|
ArrayOf<float *> inBufPos, outBufPos;
|
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
|
|
|
ChannelName map[3];
|
|
|
|
|
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
|
|
|
mBufferSize = 0;
|
|
|
|
mBlockSize = 0;
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
bool clear = false;
|
2014-11-07 09:54:04 +00:00
|
|
|
|
2017-04-11 21:55:19 +00:00
|
|
|
const bool multichannel = mNumAudioIn > 1;
|
|
|
|
auto range = multichannel
|
|
|
|
? mOutputTracks->Leaders()
|
|
|
|
: mOutputTracks->Any();
|
|
|
|
range.VisitWhile( bGoodResult,
|
|
|
|
[&](WaveTrack *left, const Track::Fallthrough &fallthrough) {
|
|
|
|
if (!left->GetSelected())
|
|
|
|
return fallthrough();
|
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-04-11 21:55:19 +00:00
|
|
|
sampleCount len;
|
|
|
|
sampleCount leftStart;
|
2017-04-16 20:36:46 +00:00
|
|
|
sampleCount rightStart = 0;
|
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-11-07 09:54:04 +00:00
|
|
|
if (!isGenerator)
|
|
|
|
{
|
2017-04-11 21:55:19 +00:00
|
|
|
GetSamples(left, &leftStart, &len);
|
|
|
|
mSampleCnt = len;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
len = 0;
|
|
|
|
leftStart = 0;
|
|
|
|
mSampleCnt = left->TimeToLongSamples(mDuration);
|
2014-11-07 09:54:04 +00:00
|
|
|
}
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2017-04-16 20:36:46 +00:00
|
|
|
mNumChannels = 0;
|
|
|
|
WaveTrack *right{};
|
|
|
|
|
|
|
|
// Iterate either over one track which could be any channel,
|
|
|
|
// or if multichannel, then over all channels of left,
|
|
|
|
// which is a leader.
|
|
|
|
for (auto channel :
|
|
|
|
TrackList::Channels(left).StartingWith(left)) {
|
|
|
|
if (channel->GetChannel() == Track::LeftChannel)
|
|
|
|
map[mNumChannels] = ChannelNameFrontLeft;
|
|
|
|
else if (channel->GetChannel() == Track::RightChannel)
|
|
|
|
map[mNumChannels] = ChannelNameFrontRight;
|
|
|
|
else
|
|
|
|
map[mNumChannels] = ChannelNameMono;
|
2017-04-11 21:55:19 +00:00
|
|
|
|
2017-04-16 20:36:46 +00:00
|
|
|
++ mNumChannels;
|
|
|
|
map[mNumChannels] = ChannelNameEOL;
|
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-04-16 20:36:46 +00:00
|
|
|
if (! multichannel)
|
|
|
|
break;
|
2017-04-11 21:55:19 +00:00
|
|
|
|
2017-04-16 20:36:46 +00:00
|
|
|
if (mNumChannels == 2) {
|
|
|
|
// TODO: more-than-two-channels
|
|
|
|
right = channel;
|
|
|
|
clear = false;
|
|
|
|
if (!isGenerator)
|
|
|
|
GetSamples(right, &rightStart, &len);
|
|
|
|
|
|
|
|
// Ignore other channels
|
|
|
|
break;
|
2017-04-11 21:55: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
|
|
|
|
2017-04-11 21:55:19 +00:00
|
|
|
// Let the client know the sample rate
|
|
|
|
SetSampleRate(left->GetRate());
|
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-04-11 21:55:19 +00:00
|
|
|
// Get the block size the client wants to use
|
|
|
|
auto max = left->GetMaxBlockSize() * 2;
|
|
|
|
mBlockSize = SetBlockSize(max);
|
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-04-11 21:55:19 +00:00
|
|
|
// Calculate the buffer size to be at least the max rounded up to the clients
|
|
|
|
// selected block size.
|
|
|
|
const auto prevBufferSize = mBufferSize;
|
|
|
|
mBufferSize = ((max + (mBlockSize - 1)) / mBlockSize) * mBlockSize;
|
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-04-11 21:55:19 +00:00
|
|
|
// If the buffer size has changed, then (re)allocate the buffers
|
|
|
|
if (prevBufferSize != mBufferSize)
|
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-04-11 21:55:19 +00:00
|
|
|
// Always create the number of input buffers the client expects even if we don't have
|
|
|
|
// the same number of channels.
|
|
|
|
inBufPos.reinit( mNumAudioIn );
|
|
|
|
inBuffer.reinit( mNumAudioIn, mBufferSize );
|
|
|
|
|
|
|
|
// We won't be using more than the first 2 buffers, so clear the rest (if any)
|
|
|
|
for (size_t i = 2; i < mNumAudioIn; i++)
|
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-04-11 21:55:19 +00:00
|
|
|
for (size_t j = 0; j < mBufferSize; j++)
|
|
|
|
{
|
|
|
|
inBuffer[i][j] = 0.0;
|
|
|
|
}
|
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-04-11 21:55:19 +00:00
|
|
|
// Always create the number of output buffers the client expects even if we don't have
|
|
|
|
// the same number of channels.
|
|
|
|
outBufPos.reinit( mNumAudioOut );
|
|
|
|
// Output buffers get an extra mBlockSize worth to give extra room if
|
|
|
|
// the plugin adds latency
|
|
|
|
outBuffer.reinit( mNumAudioOut, mBufferSize + mBlockSize );
|
|
|
|
}
|
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-04-11 21:55:19 +00:00
|
|
|
// (Re)Set the input buffer positions
|
|
|
|
for (size_t i = 0; i < mNumAudioIn; i++)
|
|
|
|
{
|
|
|
|
inBufPos[i] = inBuffer[i].get();
|
|
|
|
}
|
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-04-11 21:55:19 +00:00
|
|
|
// (Re)Set the output buffer positions
|
|
|
|
for (size_t i = 0; i < mNumAudioOut; i++)
|
|
|
|
{
|
|
|
|
outBufPos[i] = outBuffer[i].get();
|
|
|
|
}
|
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-04-11 21:55:19 +00:00
|
|
|
// Clear unused input buffers
|
|
|
|
if (!right && !clear && mNumAudioIn > 1)
|
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-04-11 21:55:19 +00:00
|
|
|
for (size_t j = 0; j < mBufferSize; j++)
|
|
|
|
{
|
|
|
|
inBuffer[1][j] = 0.0;
|
|
|
|
}
|
|
|
|
clear = true;
|
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-04-11 21:55:19 +00:00
|
|
|
// Go process the track(s)
|
|
|
|
bGoodResult = ProcessTrack(
|
|
|
|
count, map, left, right, leftStart, rightStart, len,
|
|
|
|
inBuffer, outBuffer, inBufPos, outBufPos);
|
|
|
|
if (!bGoodResult)
|
|
|
|
return;
|
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-04-11 21:55:19 +00:00
|
|
|
count++;
|
|
|
|
},
|
|
|
|
[&](Track *t) {
|
|
|
|
if (t->IsSyncLockSelected())
|
|
|
|
t->SyncLockAdjust(mT1, mT0 + mDuration);
|
|
|
|
}
|
|
|
|
);
|
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-05-05 01:52:25 +00:00
|
|
|
if (bGoodResult && GetType() == EffectTypeGenerate)
|
|
|
|
{
|
|
|
|
mT1 = mT0 + mDuration;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
return bGoodResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::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,
|
|
|
|
sampleCount leftStart,
|
|
|
|
sampleCount rightStart,
|
2016-12-16 18:27:24 +00:00
|
|
|
sampleCount len,
|
|
|
|
FloatBuffers &inBuffer,
|
|
|
|
FloatBuffers &outBuffer,
|
|
|
|
ArrayOf< float * > &inBufPos,
|
|
|
|
ArrayOf< float *> &outBufPos)
|
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
|
|
|
{
|
|
|
|
bool rc = true;
|
|
|
|
|
|
|
|
// Give the plugin a chance to initialize
|
2015-04-17 03:53:42 +00:00
|
|
|
if (!ProcessInitialize(len, map))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
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-12-16 18:27:24 +00:00
|
|
|
{ // Start scope for cleanup
|
|
|
|
auto cleanup = finally( [&] {
|
|
|
|
// Allow the plugin to cleanup
|
|
|
|
if (!ProcessFinalize())
|
|
|
|
{
|
|
|
|
// In case of non-exceptional flow of control, set rc
|
|
|
|
rc = false;
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
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 each input block of samples, we pass it to the effect along with a
|
|
|
|
// variable output location. This output location is simply a pointer into a
|
|
|
|
// much larger buffer. This reduces the number of calls required to add the
|
|
|
|
// samples to the output track.
|
|
|
|
//
|
|
|
|
// Upon return from the effect, the output samples are "moved to the left" by
|
2014-10-29 03:46:53 +00:00
|
|
|
// the number of samples in the current latency setting, effectively removing any
|
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
|
|
|
// delay introduced by the effect.
|
|
|
|
//
|
2014-10-29 03:46:53 +00:00
|
|
|
// At the same time the total number of delayed samples are gathered and when
|
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
|
|
|
// there is no further input data to process, the loop continues to call the
|
2019-09-05 20:01:46 +00:00
|
|
|
// effect with an empty input buffer until the effect has had a chance to
|
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
|
|
|
// return all of the remaining delayed samples.
|
2016-08-24 15:24:26 +00:00
|
|
|
auto inLeftPos = leftStart;
|
|
|
|
auto inRightPos = rightStart;
|
|
|
|
auto outLeftPos = leftStart;
|
|
|
|
auto outRightPos = rightStart;
|
|
|
|
|
|
|
|
auto inputRemaining = len;
|
|
|
|
decltype(GetLatency()) curDelay = 0, delayRemaining = 0;
|
|
|
|
decltype(mBlockSize) curBlockSize = 0;
|
|
|
|
|
|
|
|
decltype(mBufferSize) inputBufferCnt = 0;
|
|
|
|
decltype(mBufferSize) outputBufferCnt = 0;
|
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
|
|
|
bool cleared = false;
|
|
|
|
|
2016-04-17 04:30:18 +00:00
|
|
|
auto chans = std::min<unsigned>(mNumAudioOut, mNumChannels);
|
2015-01-11 22:52:08 +00:00
|
|
|
|
2018-11-19 04:07:05 +00:00
|
|
|
std::shared_ptr<WaveTrack> genLeft, genRight;
|
2017-11-04 17:09:01 +00:00
|
|
|
|
2016-08-24 15:24:26 +00:00
|
|
|
decltype(len) genLength = 0;
|
2015-04-17 03:53:42 +00:00
|
|
|
bool isGenerator = GetType() == EffectTypeGenerate;
|
|
|
|
bool isProcessor = GetType() == EffectTypeProcess;
|
2016-08-20 22:13:49 +00:00
|
|
|
double genDur = 0;
|
2014-11-07 09:54:04 +00:00
|
|
|
if (isGenerator)
|
|
|
|
{
|
2015-05-28 16:31:07 +00:00
|
|
|
if (mIsPreview) {
|
|
|
|
gPrefs->Read(wxT("/AudioIO/EffectsPreviewLen"), &genDur, 6.0);
|
|
|
|
genDur = wxMin(mDuration, CalcPreviewInputLength(genDur));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
genDur = mDuration;
|
|
|
|
}
|
|
|
|
|
2017-01-18 22:31:07 +00:00
|
|
|
genLength = sampleCount((left->GetRate() * genDur) + 0.5); // round to nearest sample
|
2014-11-07 09:54:04 +00:00
|
|
|
delayRemaining = genLength;
|
|
|
|
cleared = true;
|
|
|
|
|
|
|
|
// Create temporary tracks
|
|
|
|
genLeft = mFactory->NewWaveTrack(left->GetSampleFormat(), left->GetRate());
|
2017-11-04 17:09:01 +00:00
|
|
|
|
2014-11-07 09:54:04 +00:00
|
|
|
if (right)
|
|
|
|
genRight = mFactory->NewWaveTrack(right->GetSampleFormat(), right->GetRate());
|
|
|
|
}
|
|
|
|
|
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
|
|
|
// Call the effect until we run out of input or delayed samples
|
2016-08-22 19:04:15 +00:00
|
|
|
while (inputRemaining != 0 || delayRemaining != 0)
|
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
|
|
|
{
|
|
|
|
// Still working on the input samples
|
2016-08-22 19:04:15 +00:00
|
|
|
if (inputRemaining != 0)
|
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
|
|
|
{
|
|
|
|
// Need to refill the input buffers
|
|
|
|
if (inputBufferCnt == 0)
|
|
|
|
{
|
|
|
|
// Calculate the number of samples to get
|
2016-08-21 22:05:43 +00:00
|
|
|
inputBufferCnt =
|
|
|
|
limitSampleBufferSize( mBufferSize, inputRemaining );
|
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
|
|
|
|
|
|
|
// Fill the input buffers
|
2016-12-16 18:27:24 +00:00
|
|
|
left->Get((samplePtr) inBuffer[0].get(), floatSample, inLeftPos, inputBufferCnt);
|
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
|
|
|
if (right)
|
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
right->Get((samplePtr) inBuffer[1].get(), floatSample, inRightPos, inputBufferCnt);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
// Reset the input buffer positions
|
2016-12-23 20:16:07 +00:00
|
|
|
for (size_t i = 0; i < mNumChannels; i++)
|
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-12-16 18:27:24 +00:00
|
|
|
inBufPos[i] = inBuffer[i].get();
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Calculate the number of samples to process
|
|
|
|
curBlockSize = mBlockSize;
|
|
|
|
if (curBlockSize > inputRemaining)
|
|
|
|
{
|
2019-09-05 20:01:46 +00:00
|
|
|
// We've reached the last block...set current block size to what's left
|
2016-08-31 04:49:22 +00:00
|
|
|
// inputRemaining is positive and bounded by a size_t
|
|
|
|
curBlockSize = inputRemaining.as_size_t();
|
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
|
|
|
inputRemaining = 0;
|
|
|
|
|
|
|
|
// Clear the remainder of the buffers so that a full block can be passed
|
|
|
|
// to the effect
|
2016-08-24 15:24:26 +00:00
|
|
|
auto cnt = mBlockSize - curBlockSize;
|
2016-12-23 20:16:07 +00:00
|
|
|
for (size_t i = 0; i < mNumChannels; i++)
|
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-08-24 11:56:33 +00:00
|
|
|
for (decltype(cnt) j = 0 ; j < cnt; j++)
|
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-12-16 18:27:24 +00:00
|
|
|
inBufPos[i][j + curBlockSize] = 0.0;
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Might be able to use up some of the delayed samples
|
2016-08-22 19:04:15 +00:00
|
|
|
if (delayRemaining != 0)
|
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
|
|
|
{
|
|
|
|
// Don't use more than needed
|
2016-08-27 02:02:58 +00:00
|
|
|
cnt = limitSampleBufferSize(cnt, delayRemaining);
|
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
|
|
|
delayRemaining -= cnt;
|
|
|
|
curBlockSize += cnt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// We've exhausted the input samples and are now working on the delay
|
2016-08-22 19:04:15 +00:00
|
|
|
else if (delayRemaining != 0)
|
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
|
|
|
{
|
|
|
|
// Calculate the number of samples to process
|
2016-08-27 02:02:58 +00:00
|
|
|
curBlockSize = limitSampleBufferSize( mBlockSize, delayRemaining );
|
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
|
|
|
delayRemaining -= curBlockSize;
|
|
|
|
|
|
|
|
// From this point on, we only want to feed zeros to the plugin
|
|
|
|
if (!cleared)
|
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
|
|
|
// Reset the input buffer positions
|
2016-12-23 20:16:07 +00:00
|
|
|
for (size_t i = 0; i < mNumChannels; i++)
|
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-12-16 18:27:24 +00:00
|
|
|
inBufPos[i] = inBuffer[i].get();
|
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
|
|
|
|
|
|
|
// And clear
|
2016-12-23 20:16:07 +00:00
|
|
|
for (size_t j = 0; j < mBlockSize; j++)
|
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-12-16 18:27:24 +00:00
|
|
|
inBuffer[i][j] = 0.0;
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
cleared = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Finally call the plugin to process the block
|
2016-08-24 15:24:26 +00:00
|
|
|
decltype(curBlockSize) processed;
|
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
|
|
|
try
|
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
processed = ProcessBlock(inBufPos.get(), outBufPos.get(), curBlockSize);
|
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-11-07 09:14:00 +00:00
|
|
|
catch( const AudacityException & WXUNUSED(e) )
|
2016-11-07 21:34:14 +00:00
|
|
|
{
|
|
|
|
// PRL: Bug 437:
|
|
|
|
// Pass this along to our application-level handler
|
|
|
|
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
|
|
|
catch(...)
|
|
|
|
{
|
2016-11-07 21:34:14 +00:00
|
|
|
// PRL:
|
|
|
|
// Exceptions for other reasons, maybe in third-party code...
|
|
|
|
// Continue treating them as we used to, but I wonder if these
|
|
|
|
// should now be treated the same way.
|
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
|
|
|
return false;
|
|
|
|
}
|
2015-04-17 03:53:42 +00:00
|
|
|
wxASSERT(processed == curBlockSize);
|
2016-02-26 19:41:17 +00:00
|
|
|
wxUnusedVar(processed);
|
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
|
|
|
|
|
|
|
// Bump to next input buffer position
|
2016-08-22 19:04:15 +00:00
|
|
|
if (inputRemaining != 0)
|
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-12-23 20:16:07 +00:00
|
|
|
for (size_t i = 0; i < mNumChannels; i++)
|
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-12-16 18:27:24 +00:00
|
|
|
inBufPos[i] += curBlockSize;
|
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
|
|
|
}
|
|
|
|
inputRemaining -= curBlockSize;
|
|
|
|
inputBufferCnt -= curBlockSize;
|
|
|
|
}
|
|
|
|
|
2015-01-11 22:52:08 +00:00
|
|
|
// "ls" and "rs" serve as the input sample index for the left and
|
|
|
|
// right channels when processing the input samples. If we flip
|
|
|
|
// over to processing delayed samples, they simply become counters
|
|
|
|
// for the progress display.
|
|
|
|
inLeftPos += curBlockSize;
|
|
|
|
inRightPos += curBlockSize;
|
|
|
|
|
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
|
|
|
// Get the current number of delayed samples and accumulate
|
2014-11-14 03:03:17 +00:00
|
|
|
if (isProcessor)
|
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
|
|
|
{
|
2018-10-10 16:28:50 +00:00
|
|
|
{
|
|
|
|
auto delay = GetLatency();
|
|
|
|
curDelay += delay;
|
|
|
|
delayRemaining += delay;
|
|
|
|
}
|
2014-11-07 09:54:04 +00:00
|
|
|
|
|
|
|
// If the plugin has delayed the output by more samples than our current
|
|
|
|
// block size, then we leave the output pointers alone. This effectively
|
|
|
|
// removes those delayed samples from the output buffer.
|
|
|
|
if (curDelay >= curBlockSize)
|
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-11-07 09:54:04 +00:00
|
|
|
curDelay -= curBlockSize;
|
|
|
|
curBlockSize = 0;
|
|
|
|
}
|
|
|
|
// We have some delayed samples, at the beginning of the output samples,
|
|
|
|
// so overlay them by shifting the remaining output samples.
|
|
|
|
else if (curDelay > 0)
|
|
|
|
{
|
2016-08-31 04:49:22 +00:00
|
|
|
// curDelay is bounded by curBlockSize:
|
|
|
|
auto delay = curDelay.as_size_t();
|
|
|
|
curBlockSize -= delay;
|
2016-12-23 20:16:07 +00:00
|
|
|
for (size_t i = 0; i < chans; i++)
|
2014-11-07 09:54:04 +00:00
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
memmove(outBufPos[i], outBufPos[i] + delay, sizeof(float) * curBlockSize);
|
2014-11-07 09:54:04 +00:00
|
|
|
}
|
|
|
|
curDelay = 0;
|
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-01-11 22:52:08 +00:00
|
|
|
// Adjust the number of samples in the output buffers
|
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
|
|
|
outputBufferCnt += curBlockSize;
|
|
|
|
|
2015-01-11 22:52:08 +00:00
|
|
|
// Still have room in the output buffers
|
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
|
|
|
if (outputBufferCnt < mBufferSize)
|
|
|
|
{
|
|
|
|
// Bump to next output buffer position
|
2016-12-23 20:16:07 +00:00
|
|
|
for (size_t i = 0; i < chans; i++)
|
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-12-16 18:27:24 +00:00
|
|
|
outBufPos[i] += curBlockSize;
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
// Output buffers have filled
|
|
|
|
else
|
|
|
|
{
|
2014-11-14 03:03:17 +00:00
|
|
|
if (isProcessor)
|
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-11-07 09:54:04 +00:00
|
|
|
// Write them out
|
2016-12-16 18:27:24 +00:00
|
|
|
left->Set((samplePtr) outBuffer[0].get(), floatSample, outLeftPos, outputBufferCnt);
|
2014-11-07 09:54:04 +00:00
|
|
|
if (right)
|
|
|
|
{
|
2015-05-16 15:53:04 +00:00
|
|
|
if (chans >= 2)
|
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
right->Set((samplePtr) outBuffer[1].get(), floatSample, outRightPos, outputBufferCnt);
|
2015-05-16 15:53:04 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
right->Set((samplePtr) outBuffer[0].get(), floatSample, outRightPos, outputBufferCnt);
|
2015-05-16 15:53:04 +00:00
|
|
|
}
|
2014-11-07 09:54:04 +00:00
|
|
|
}
|
|
|
|
}
|
2014-11-14 03:03:17 +00:00
|
|
|
else if (isGenerator)
|
2014-11-07 09:54:04 +00:00
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
genLeft->Append((samplePtr) outBuffer[0].get(), floatSample, outputBufferCnt);
|
2014-11-07 09:54:04 +00:00
|
|
|
if (genRight)
|
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
genRight->Append((samplePtr) outBuffer[1].get(), floatSample, outputBufferCnt);
|
2014-11-07 09:54:04 +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
|
|
|
}
|
|
|
|
|
|
|
|
// Reset the output buffer positions
|
2016-12-23 20:16:07 +00:00
|
|
|
for (size_t i = 0; i < chans; i++)
|
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-12-16 18:27:24 +00:00
|
|
|
outBufPos[i] = outBuffer[i].get();
|
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
|
|
|
}
|
|
|
|
|
|
|
|
// Bump to the next track position
|
|
|
|
outLeftPos += outputBufferCnt;
|
|
|
|
outRightPos += outputBufferCnt;
|
|
|
|
outputBufferCnt = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mNumChannels > 1)
|
|
|
|
{
|
2016-08-25 12:53:59 +00:00
|
|
|
if (TrackGroupProgress(count,
|
|
|
|
(inLeftPos - leftStart).as_double() /
|
|
|
|
(isGenerator ? genLength : len).as_double()))
|
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
|
|
|
{
|
|
|
|
rc = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-08-25 12:53:59 +00:00
|
|
|
if (TrackProgress(count,
|
|
|
|
(inLeftPos - leftStart).as_double() /
|
|
|
|
(isGenerator ? genLength : len).as_double()))
|
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
|
|
|
{
|
|
|
|
rc = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Put any remaining output
|
2016-12-16 18:27:24 +00:00
|
|
|
if (rc && outputBufferCnt)
|
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-11-14 03:03:17 +00:00
|
|
|
if (isProcessor)
|
2014-11-07 09:54:04 +00:00
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
left->Set((samplePtr) outBuffer[0].get(), floatSample, outLeftPos, outputBufferCnt);
|
2014-11-07 09:54:04 +00:00
|
|
|
if (right)
|
|
|
|
{
|
2015-05-16 15:53:04 +00:00
|
|
|
if (chans >= 2)
|
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
right->Set((samplePtr) outBuffer[1].get(), floatSample, outRightPos, outputBufferCnt);
|
2015-05-16 15:53:04 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
right->Set((samplePtr) outBuffer[0].get(), floatSample, outRightPos, outputBufferCnt);
|
2015-05-16 15:53:04 +00:00
|
|
|
}
|
2014-11-07 09:54:04 +00:00
|
|
|
}
|
|
|
|
}
|
2014-11-14 03:03:17 +00:00
|
|
|
else if (isGenerator)
|
2014-11-07 09:54:04 +00:00
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
genLeft->Append((samplePtr) outBuffer[0].get(), floatSample, outputBufferCnt);
|
2014-11-07 09:54:04 +00:00
|
|
|
if (genRight)
|
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
genRight->Append((samplePtr) outBuffer[1].get(), floatSample, outputBufferCnt);
|
2014-11-07 09:54:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
if (rc && isGenerator)
|
2014-11-07 09:54:04 +00:00
|
|
|
{
|
2015-05-28 16:31:07 +00:00
|
|
|
AudacityProject *p = GetActiveProject();
|
2016-08-20 22:13:49 +00:00
|
|
|
|
|
|
|
// PRL: this code was here and could not have been the right
|
|
|
|
// intent, mixing time and sampleCount values:
|
|
|
|
// StepTimeWarper warper(mT0 + genLength, genLength - (mT1 - mT0));
|
|
|
|
|
|
|
|
// This looks like what it should have been:
|
|
|
|
// StepTimeWarper warper(mT0 + genDur, genDur - (mT1 - mT0));
|
|
|
|
// But rather than fix it, I will just disable the use of it for now.
|
|
|
|
// The purpose was to remap split lines inside the selected region when
|
|
|
|
// a generator replaces it with sound of different duration. But
|
|
|
|
// the "correct" version might have the effect of mapping some splits too
|
2016-12-16 18:27:24 +00:00
|
|
|
// far left, to before the selection.
|
2016-08-20 22:13:49 +00:00
|
|
|
// In practice the wrong version probably did nothing most of the time,
|
|
|
|
// because the cutoff time for the step time warper was 44100 times too
|
|
|
|
// far from mT0.
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2014-11-07 09:54:04 +00:00
|
|
|
// Transfer the data from the temporary tracks to the actual ones
|
|
|
|
genLeft->Flush();
|
2016-02-13 15:43:16 +00:00
|
|
|
// mT1 gives us the NEW selection. We want to replace up to GetSel1().
|
2019-04-28 10:49:47 +00:00
|
|
|
auto &selectedRegion = ViewInfo::Get( *p ).selectedRegion;
|
2019-03-27 08:15:28 +00:00
|
|
|
left->ClearAndPaste(mT0,
|
|
|
|
selectedRegion.t1(), genLeft.get(), true, true,
|
|
|
|
nullptr /* &warper */);
|
2014-11-07 09:54:04 +00:00
|
|
|
|
|
|
|
if (genRight)
|
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-11-07 09:54:04 +00:00
|
|
|
genRight->Flush();
|
2016-08-20 22:13:49 +00:00
|
|
|
right->ClearAndPaste(mT0, mT1, genRight.get(), true, true,
|
|
|
|
nullptr /* &warper */);
|
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-12-16 18:27:24 +00:00
|
|
|
} // End scope for cleanup
|
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
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Effect::End()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
void Effect::PopulateOrExchange(ShuttleGui & WXUNUSED(S))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::TransferDataToWindow()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::TransferDataFromWindow()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::EnableApply(bool enable)
|
|
|
|
{
|
|
|
|
// May be called during initialization, so try to find the dialog
|
|
|
|
wxWindow *dlg = mUIDialog;
|
|
|
|
if (!dlg && mUIParent)
|
|
|
|
{
|
|
|
|
dlg = wxGetTopLevelParent(mUIParent);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dlg)
|
|
|
|
{
|
|
|
|
wxWindow *apply = dlg->FindWindow(wxID_APPLY);
|
|
|
|
|
|
|
|
// Don't allow focus to get trapped
|
|
|
|
if (!enable)
|
|
|
|
{
|
|
|
|
wxWindow *focus = dlg->FindFocus();
|
|
|
|
if (focus == apply)
|
|
|
|
{
|
|
|
|
dlg->FindWindow(wxID_CLOSE)->SetFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply->Enable(enable);
|
|
|
|
}
|
|
|
|
|
|
|
|
EnablePreview(enable);
|
|
|
|
|
|
|
|
return enable;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::EnablePreview(bool enable)
|
|
|
|
{
|
|
|
|
// May be called during initialization, so try to find the dialog
|
|
|
|
wxWindow *dlg = mUIDialog;
|
|
|
|
if (!dlg && mUIParent)
|
|
|
|
{
|
|
|
|
dlg = wxGetTopLevelParent(mUIParent);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dlg)
|
|
|
|
{
|
|
|
|
wxWindow *play = dlg->FindWindow(kPlayID);
|
|
|
|
if (play)
|
|
|
|
{
|
|
|
|
wxWindow *rewind = dlg->FindWindow(kRewindID);
|
|
|
|
wxWindow *ffwd = dlg->FindWindow(kFFwdID);
|
|
|
|
|
|
|
|
// Don't allow focus to get trapped
|
|
|
|
if (!enable)
|
|
|
|
{
|
|
|
|
wxWindow *focus = dlg->FindFocus();
|
|
|
|
if (focus && (focus == play || focus == rewind || focus == ffwd))
|
|
|
|
{
|
|
|
|
dlg->FindWindow(wxID_CLOSE)->SetFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
play->Enable(enable);
|
|
|
|
if (SupportsRealtime())
|
|
|
|
{
|
|
|
|
rewind->Enable(enable);
|
|
|
|
ffwd->Enable(enable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return enable;
|
|
|
|
}
|
|
|
|
|
2015-04-22 20:55:58 +00:00
|
|
|
void Effect::EnableDebug(bool enable)
|
|
|
|
{
|
|
|
|
mUIDebug = enable;
|
|
|
|
}
|
|
|
|
|
2015-05-15 11:47:51 +00:00
|
|
|
void Effect::SetLinearEffectFlag(bool linearEffectFlag)
|
|
|
|
{
|
|
|
|
mIsLinearEffect = linearEffectFlag;
|
|
|
|
}
|
|
|
|
|
2015-05-28 16:31:07 +00:00
|
|
|
void Effect::SetPreviewFullSelectionFlag(bool previewDurationFlag)
|
|
|
|
{
|
|
|
|
mPreviewFullSelection = previewDurationFlag;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-15 15:57:29 +00:00
|
|
|
void Effect::IncludeNotSelectedPreviewTracks(bool includeNotSelected)
|
|
|
|
{
|
|
|
|
mPreviewWithNotSelected = includeNotSelected;
|
|
|
|
}
|
|
|
|
|
2019-12-08 03:37:02 +00:00
|
|
|
bool Effect::TotalProgress(double frac, const TranslatableString &msg)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2016-12-24 15:43:25 +00:00
|
|
|
auto updateResult = (mProgress ?
|
2018-07-24 15:10:52 +00:00
|
|
|
mProgress->Update(frac, msg) :
|
2016-12-24 15:43:25 +00:00
|
|
|
ProgressResult::Success);
|
|
|
|
return (updateResult != ProgressResult::Success);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
2019-12-08 03:37:02 +00:00
|
|
|
bool Effect::TrackProgress(int whichTrack, double frac, const TranslatableString &msg)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2016-12-24 15:43:25 +00:00
|
|
|
auto updateResult = (mProgress ?
|
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
|
|
|
mProgress->Update(whichTrack + frac, (double) mNumTracks, msg) :
|
2016-12-24 15:43:25 +00:00
|
|
|
ProgressResult::Success);
|
|
|
|
return (updateResult != ProgressResult::Success);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
2019-12-08 03:37:02 +00:00
|
|
|
bool Effect::TrackGroupProgress(int whichGroup, double frac, const TranslatableString &msg)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2016-12-24 15:43:25 +00:00
|
|
|
auto updateResult = (mProgress ?
|
2015-08-12 13:19:01 +00:00
|
|
|
mProgress->Update(whichGroup + frac, (double) mNumGroups, msg) :
|
2016-12-24 15:43:25 +00:00
|
|
|
ProgressResult::Success);
|
|
|
|
return (updateResult != ProgressResult::Success);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
2017-02-22 19:23:35 +00:00
|
|
|
void Effect::GetSamples(
|
|
|
|
const WaveTrack *track, sampleCount *start, sampleCount *len)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
double trackStart = track->GetStartTime();
|
|
|
|
double trackEnd = track->GetEndTime();
|
|
|
|
double t0 = mT0 < trackStart ? trackStart : mT0;
|
|
|
|
double t1 = mT1 > trackEnd ? trackEnd : mT1;
|
|
|
|
|
2014-11-07 09:54:04 +00:00
|
|
|
#if 0
|
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
|
|
|
if (GetType() & INSERT_EFFECT) {
|
2014-11-07 09:54:04 +00:00
|
|
|
t1 = t0 + mDuration;
|
2010-01-23 19:44:49 +00:00
|
|
|
if (mT0 == mT1) {
|
|
|
|
// Not really part of the calculation, but convenient to put here
|
2017-03-23 15:10:14 +00:00
|
|
|
track->InsertSilence(t0, t1);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
}
|
2014-11-07 09:54:04 +00:00
|
|
|
#endif
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
if (t1 > t0) {
|
|
|
|
*start = track->TimeToLongSamples(t0);
|
2016-08-24 15:24:26 +00:00
|
|
|
auto end = track->TimeToLongSamples(t1);
|
2016-08-24 12:02:09 +00:00
|
|
|
*len = end - *start;
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
*start = 0;
|
|
|
|
*len = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// private methods
|
|
|
|
//
|
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).
|
|
|
|
// Copy the group tracks that have tracks selected
|
2016-12-31 09:54:52 +00:00
|
|
|
// If not all sync-locked selected, then only selected wave tracks.
|
|
|
|
void Effect::CopyInputTracks(bool allSyncLockSelected)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
// Reset map
|
2016-09-08 15:04:35 +00:00
|
|
|
mIMap.clear();
|
|
|
|
mOMap.clear();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-05-21 15:22:19 +00:00
|
|
|
mOutputTracks = TrackList::Create( nullptr );
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-12-31 09:54:52 +00:00
|
|
|
auto trackRange = mTracks->Any() +
|
|
|
|
[&] (const Track *pTrack) {
|
|
|
|
return allSyncLockSelected
|
|
|
|
? pTrack->IsSelectedOrSyncLockSelected()
|
|
|
|
: track_cast<const WaveTrack*>( pTrack ) && pTrack->GetSelected();
|
|
|
|
};
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
t2bHash added;
|
|
|
|
|
2016-12-31 09:54:52 +00:00
|
|
|
for (auto aTrack : trackRange)
|
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-12-31 09:54:52 +00:00
|
|
|
Track *o = mOutputTracks->Add(aTrack->Duplicate());
|
|
|
|
mIMap.push_back(aTrack);
|
|
|
|
mOMap.push_back(o);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-19 04:07:05 +00:00
|
|
|
Track *Effect::AddToOutputTracks(const std::shared_ptr<Track> &t)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2016-09-08 15:04:35 +00:00
|
|
|
mIMap.push_back(NULL);
|
|
|
|
mOMap.push_back(t.get());
|
2018-11-19 04:07:05 +00:00
|
|
|
return mOutputTracks->Add(t);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
2016-02-27 19:24:57 +00:00
|
|
|
Effect::AddedAnalysisTrack::AddedAnalysisTrack(Effect *pEffect, const wxString &name)
|
|
|
|
: mpEffect(pEffect)
|
|
|
|
{
|
2016-03-02 19:59:31 +00:00
|
|
|
LabelTrack::Holder pTrack{ pEffect->mFactory->NewLabelTrack() };
|
2016-02-27 19:24:57 +00:00
|
|
|
mpTrack = pTrack.get();
|
|
|
|
if (!name.empty())
|
|
|
|
pTrack->SetName(name);
|
2018-11-19 18:17:28 +00:00
|
|
|
pEffect->mTracks->Add( pTrack );
|
2016-02-27 19:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Effect::AddedAnalysisTrack::AddedAnalysisTrack(AddedAnalysisTrack &&that)
|
|
|
|
{
|
|
|
|
mpEffect = that.mpEffect;
|
|
|
|
mpTrack = that.mpTrack;
|
|
|
|
that.Commit();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Effect::AddedAnalysisTrack::Commit()
|
|
|
|
{
|
|
|
|
mpEffect = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
Effect::AddedAnalysisTrack::~AddedAnalysisTrack()
|
|
|
|
{
|
|
|
|
if (mpEffect) {
|
|
|
|
// not committed -- DELETE the label track
|
2016-03-01 21:28:59 +00:00
|
|
|
mpEffect->mTracks->Remove(mpTrack);
|
2016-02-27 19:24:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-07 06:29:26 +00:00
|
|
|
auto Effect::AddAnalysisTrack(const wxString &name) -> std::shared_ptr<AddedAnalysisTrack>
|
2016-02-27 19:24:57 +00:00
|
|
|
{
|
2016-03-07 06:29:26 +00:00
|
|
|
return std::shared_ptr<AddedAnalysisTrack>
|
2016-08-14 03:16:05 +00:00
|
|
|
{ safenew AddedAnalysisTrack{ this, name } };
|
2016-02-27 19:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack
|
|
|
|
(Effect *pEffect, const LabelTrack *pOrigTrack, const wxString &name)
|
|
|
|
: mpEffect(pEffect)
|
|
|
|
{
|
|
|
|
// copy LabelTrack here, so it can be undone on cancel
|
2016-03-02 20:36:44 +00:00
|
|
|
auto newTrack = pOrigTrack->Copy(pOrigTrack->GetStartTime(), pOrigTrack->GetEndTime());
|
2016-02-27 19:24:57 +00:00
|
|
|
|
2016-03-02 20:36:44 +00:00
|
|
|
mpTrack = static_cast<LabelTrack*>(newTrack.get());
|
2016-02-27 19:24:57 +00:00
|
|
|
|
|
|
|
// Why doesn't LabelTrack::Copy complete the job? :
|
|
|
|
mpTrack->SetOffset(pOrigTrack->GetStartTime());
|
|
|
|
if (!name.empty())
|
|
|
|
mpTrack->SetName(name);
|
|
|
|
|
2016-03-01 00:54:21 +00:00
|
|
|
// mpOrigTrack came from mTracks which we own but expose as const to subclasses
|
|
|
|
// So it's okay that we cast it back to const
|
2016-03-13 15:08:21 +00:00
|
|
|
mpOrigTrack =
|
|
|
|
pEffect->mTracks->Replace(const_cast<LabelTrack*>(pOrigTrack),
|
2018-11-19 18:17:28 +00:00
|
|
|
newTrack );
|
2016-02-27 19:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack(ModifiedAnalysisTrack &&that)
|
|
|
|
{
|
|
|
|
mpEffect = that.mpEffect;
|
|
|
|
mpTrack = that.mpTrack;
|
2016-03-13 15:08:21 +00:00
|
|
|
mpOrigTrack = std::move(that.mpOrigTrack);
|
2016-02-27 19:24:57 +00:00
|
|
|
that.Commit();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Effect::ModifiedAnalysisTrack::Commit()
|
|
|
|
{
|
|
|
|
mpEffect = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
Effect::ModifiedAnalysisTrack::~ModifiedAnalysisTrack()
|
|
|
|
{
|
|
|
|
if (mpEffect) {
|
|
|
|
// not committed -- DELETE the label track
|
2016-03-01 00:54:21 +00:00
|
|
|
// mpOrigTrack came from mTracks which we own but expose as const to subclasses
|
|
|
|
// So it's okay that we cast it back to const
|
2018-11-19 18:17:28 +00:00
|
|
|
mpEffect->mTracks->Replace(mpTrack, mpOrigTrack);
|
2016-02-27 19:24:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Effect::ModifyAnalysisTrack
|
|
|
|
(const LabelTrack *pOrigTrack, const wxString &name) -> ModifiedAnalysisTrack
|
|
|
|
{
|
|
|
|
return{ this, pOrigTrack, name };
|
|
|
|
}
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// If bGoodResult, replace mTracks tracks with successfully processed mOutputTracks copies.
|
2016-02-14 23:50:45 +00:00
|
|
|
// Else clear and DELETE mOutputTracks copies.
|
2010-01-23 19:44:49 +00:00
|
|
|
void Effect::ReplaceProcessedTracks(const bool bGoodResult)
|
|
|
|
{
|
|
|
|
if (!bGoodResult) {
|
2016-12-16 18:27:24 +00:00
|
|
|
// Free resources, unless already freed.
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// Processing failed or was cancelled so throw away the processed tracks.
|
2016-12-16 18:27:24 +00:00
|
|
|
if ( mOutputTracks )
|
|
|
|
mOutputTracks->Clear();
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// Reset map
|
2016-09-08 15:04:35 +00:00
|
|
|
mIMap.clear();
|
|
|
|
mOMap.clear();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
//TODO:undo the non-gui ODTask transfer
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
// Assume resources need to be freed.
|
|
|
|
wxASSERT(mOutputTracks); // Make sure we at least did the CopyInputTracks().
|
|
|
|
|
2018-01-14 19:01:04 +00:00
|
|
|
auto iterOut = mOutputTracks->ListOfTracks::begin(),
|
|
|
|
iterEnd = mOutputTracks->ListOfTracks::end();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-09-08 15:04:35 +00:00
|
|
|
size_t cnt = mOMap.size();
|
2010-01-23 19:44:49 +00:00
|
|
|
size_t i = 0;
|
|
|
|
|
2016-03-02 06:39:56 +00:00
|
|
|
for (; iterOut != iterEnd; ++i) {
|
2018-11-19 18:17:28 +00:00
|
|
|
ListOfTracks::value_type o = *iterOut;
|
2010-01-23 19:44:49 +00:00
|
|
|
// If tracks were removed from mOutputTracks, then there will be
|
|
|
|
// tracks in the map that must be removed from mTracks.
|
2016-03-13 15:08:21 +00:00
|
|
|
while (i < cnt && mOMap[i] != o.get()) {
|
2016-09-08 15:04:35 +00:00
|
|
|
const auto t = mIMap[i];
|
2010-01-23 19:44:49 +00:00
|
|
|
if (t) {
|
2016-03-01 21:28:59 +00:00
|
|
|
mTracks->Remove(t);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This should never happen
|
|
|
|
wxASSERT(i < cnt);
|
|
|
|
|
2016-02-14 23:50:45 +00:00
|
|
|
// Remove the track from the output list...don't DELETE it
|
2016-03-02 06:39:56 +00:00
|
|
|
iterOut = mOutputTracks->erase(iterOut);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-09-08 15:04:35 +00:00
|
|
|
const auto t = mIMap[i];
|
2010-01-23 19:44:49 +00:00
|
|
|
if (t == NULL)
|
|
|
|
{
|
2016-02-13 15:43:16 +00:00
|
|
|
// This track is a NEW addition to output tracks; add it to mTracks
|
2018-11-19 18:17:28 +00:00
|
|
|
mTracks->Add( o );
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-02-13 15:43:16 +00:00
|
|
|
// Replace mTracks entry with the NEW track
|
2018-11-19 18:17:28 +00:00
|
|
|
mTracks->Replace(t, o);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-09-21 14:23:05 +00:00
|
|
|
// If the track is a wave track,
|
2016-02-13 15:43:16 +00:00
|
|
|
// Swap the wavecache track the ondemand task uses, since now the NEW
|
2010-01-23 19:44:49 +00:00
|
|
|
// one will be kept in the project
|
|
|
|
if (ODManager::IsInstanceCreated()) {
|
2019-06-05 15:46:07 +00:00
|
|
|
ODManager::Instance()->ReplaceWaveTrack( t, o );
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If tracks were removed from mOutputTracks, then there may be tracks
|
|
|
|
// left at the end of the map that must be removed from mTracks.
|
|
|
|
while (i < cnt) {
|
2016-09-08 15:04:35 +00:00
|
|
|
const auto t = mIMap[i];
|
2010-01-23 19:44:49 +00:00
|
|
|
if (t) {
|
2016-09-08 15:04:35 +00:00
|
|
|
mTracks->Remove(t);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Reset map
|
2016-09-08 15:04:35 +00:00
|
|
|
mIMap.clear();
|
|
|
|
mOMap.clear();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
// Make sure we processed everything
|
2016-03-02 06:39:56 +00:00
|
|
|
wxASSERT(mOutputTracks->empty());
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// The output list is no longer needed
|
2016-08-13 13:26:53 +00:00
|
|
|
mOutputTracks.reset();
|
2018-02-24 10:31:50 +00:00
|
|
|
nEffectsDone++;
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Effect::CountWaveTracks()
|
|
|
|
{
|
2018-09-11 17:07:32 +00:00
|
|
|
mNumTracks = mTracks->Selected< const WaveTrack >().size();
|
|
|
|
mNumGroups = mTracks->SelectedLeaders< const WaveTrack >().size();
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
2013-02-15 00:24:43 +00:00
|
|
|
double Effect::CalcPreviewInputLength(double previewLength)
|
|
|
|
{
|
|
|
|
return previewLength;
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
bool Effect::IsHidden()
|
2014-12-13 18:24:11 +00:00
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
return false;
|
2014-12-13 18:24:11 +00:00
|
|
|
}
|
|
|
|
|
2013-05-02 23:41:27 +00:00
|
|
|
void Effect::Preview(bool dryOnly)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2015-05-28 16:31:07 +00:00
|
|
|
if (mNumTracks == 0) { // nothing to preview
|
2013-05-19 05:56:42 +00:00
|
|
|
return;
|
2015-05-28 16:31:07 +00:00
|
|
|
}
|
2013-05-19 05:56:42 +00:00
|
|
|
|
2019-06-10 18:25:50 +00:00
|
|
|
auto gAudioIO = AudioIO::Get();
|
2015-05-28 16:31:07 +00:00
|
|
|
if (gAudioIO->IsBusy()) {
|
2010-01-23 19:44:49 +00:00
|
|
|
return;
|
2015-05-28 16:31:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
wxWindow *FocusDialog = wxWindow::FindFocus();
|
|
|
|
|
|
|
|
double previewDuration;
|
2019-02-28 18:16:09 +00:00
|
|
|
bool isNyquist = GetFamily() == NYQUISTEFFECTS_FAMILY;
|
2015-05-28 16:31:07 +00:00
|
|
|
bool isGenerator = GetType() == EffectTypeGenerate;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
// Mix a few seconds of audio from all of the tracks
|
2015-05-28 16:31:07 +00:00
|
|
|
double previewLen;
|
|
|
|
gPrefs->Read(wxT("/AudioIO/EffectsPreviewLen"), &previewLen, 6.0);
|
2013-02-15 00:24:43 +00:00
|
|
|
|
2016-05-19 20:26:20 +00:00
|
|
|
const double rate = mProjectRate;
|
2015-05-28 16:31:07 +00:00
|
|
|
|
|
|
|
if (isNyquist && isGenerator) {
|
|
|
|
previewDuration = CalcPreviewInputLength(previewLen);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
previewDuration = wxMin(mDuration, CalcPreviewInputLength(previewLen));
|
|
|
|
}
|
|
|
|
|
|
|
|
double t1 = mT0 + previewDuration;
|
|
|
|
|
2019-09-05 20:01:46 +00:00
|
|
|
if ((t1 > mT1) && !isGenerator) {
|
2015-05-15 11:47:51 +00:00
|
|
|
t1 = mT1;
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
2015-05-28 16:31:07 +00:00
|
|
|
|
|
|
|
if (t1 <= mT0)
|
2015-05-15 11:47:51 +00:00
|
|
|
return;
|
|
|
|
|
2015-05-16 08:00:47 +00:00
|
|
|
bool success = true;
|
2016-12-16 18:27:24 +00:00
|
|
|
|
|
|
|
auto cleanup = finally( [&] {
|
|
|
|
|
|
|
|
// Effect is already inited; we will call Process, End, and then Init
|
|
|
|
// again, so the state is exactly the way it was before Preview
|
|
|
|
// was called.
|
|
|
|
if (!dryOnly) {
|
|
|
|
End();
|
2018-01-13 06:32:41 +00:00
|
|
|
GuardedCall( [&]{ Init(); } );
|
2015-05-15 11:47:51 +00:00
|
|
|
}
|
2018-04-24 23:53:53 +00:00
|
|
|
} );
|
2016-12-16 18:27:24 +00:00
|
|
|
|
2018-04-24 23:53:53 +00:00
|
|
|
auto vr0 = valueRestorer( mT0 );
|
|
|
|
auto vr1 = valueRestorer( mT1 );
|
|
|
|
// Most effects should stop at t1.
|
|
|
|
if (!mPreviewFullSelection)
|
|
|
|
mT1 = t1;
|
|
|
|
|
|
|
|
// Save the original track list
|
|
|
|
TrackList *saveTracks = mTracks;
|
|
|
|
|
|
|
|
auto cleanup2 = finally( [&] {
|
|
|
|
mTracks = saveTracks;
|
2016-12-16 18:27:24 +00:00
|
|
|
if (FocusDialog) {
|
|
|
|
FocusDialog->SetFocus();
|
2015-05-15 11:47:51 +00:00
|
|
|
}
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
// In case of failed effect, be sure to free memory.
|
|
|
|
ReplaceProcessedTracks( false );
|
|
|
|
} );
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
// Build NEW tracklist from rendering tracks
|
2019-05-21 15:22:19 +00:00
|
|
|
// Set the same owning project, so FindProject() can see it within Process()
|
|
|
|
const auto pProject = saveTracks->GetOwner();
|
|
|
|
auto uTracks = TrackList::Create( pProject );
|
2016-12-16 18:27:24 +00:00
|
|
|
mTracks = uTracks.get();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
// Linear Effect preview optimised by pre-mixing to one track.
|
|
|
|
// Generators need to generate per track.
|
|
|
|
if (mIsLinearEffect && !isGenerator) {
|
|
|
|
WaveTrack::Holder mixLeft, mixRight;
|
|
|
|
MixAndRender(saveTracks, mFactory, rate, floatSample, mT0, t1, mixLeft, mixRight);
|
|
|
|
if (!mixLeft)
|
|
|
|
return;
|
2016-08-16 17:30:26 +00:00
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
mixLeft->Offset(-mixLeft->GetStartTime());
|
|
|
|
mixLeft->SetSelected(true);
|
2019-07-09 14:29:29 +00:00
|
|
|
WaveTrackView::Get( *mixLeft )
|
|
|
|
.SetDisplay(WaveTrackViewConstants::NoDisplay);
|
2018-11-19 18:17:28 +00:00
|
|
|
auto pLeft = mTracks->Add( mixLeft );
|
2018-10-04 15:34:14 +00:00
|
|
|
Track *pRight{};
|
2016-12-16 18:27:24 +00:00
|
|
|
if (mixRight) {
|
|
|
|
mixRight->Offset(-mixRight->GetStartTime());
|
|
|
|
mixRight->SetSelected(true);
|
2018-11-19 18:17:28 +00:00
|
|
|
pRight = mTracks->Add( mixRight );
|
2016-12-16 18:27:24 +00:00
|
|
|
}
|
2018-10-04 15:34:14 +00:00
|
|
|
mTracks->GroupChannels(*pLeft, pRight ? 2 : 1);
|
2016-12-16 18:27:24 +00:00
|
|
|
}
|
|
|
|
else {
|
2018-09-11 17:07:32 +00:00
|
|
|
for (auto src : saveTracks->Any< const WaveTrack >()) {
|
2016-12-16 18:27:24 +00:00
|
|
|
if (src->GetSelected() || mPreviewWithNotSelected) {
|
|
|
|
auto dest = src->Copy(mT0, t1);
|
|
|
|
dest->SetSelected(src->GetSelected());
|
2019-07-09 14:29:29 +00:00
|
|
|
WaveTrackView::Get( *static_cast<WaveTrack*>(dest.get()) )
|
|
|
|
.SetDisplay(WaveTrackViewConstants::NoDisplay);
|
2018-11-19 18:17:28 +00:00
|
|
|
mTracks->Add( dest );
|
2016-08-16 17:30:26 +00:00
|
|
|
}
|
2016-12-16 18:27:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-19 06:28:05 +00:00
|
|
|
// NEW tracks start at time zero.
|
2017-11-19 07:10:01 +00:00
|
|
|
// Adjust mT0 and mT1 to be the times to process, and to
|
|
|
|
// play back in these tracks
|
2017-11-19 06:28:05 +00:00
|
|
|
mT1 -= mT0;
|
|
|
|
mT0 = 0.0;
|
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
// Update track/group counts
|
|
|
|
CountWaveTracks();
|
|
|
|
|
|
|
|
// Apply effect
|
|
|
|
if (!dryOnly) {
|
|
|
|
ProgressDialog progress{
|
2019-12-19 16:44:00 +00:00
|
|
|
GetName(),
|
2019-12-08 03:37:02 +00:00
|
|
|
XO("Preparing preview"),
|
2016-12-16 18:27:24 +00:00
|
|
|
pdlgHideCancelButton
|
|
|
|
}; // Have only "Stop" button.
|
|
|
|
auto vr = valueRestorer( mProgress, &progress );
|
|
|
|
|
|
|
|
auto vr2 = valueRestorer( mIsPreview, true );
|
|
|
|
|
|
|
|
success = Process();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2019-07-01 16:35:53 +00:00
|
|
|
auto tracks = ProjectAudioManager::GetAllPlaybackTracks(*mTracks, true);
|
2016-12-16 18:27:24 +00:00
|
|
|
|
|
|
|
// Some effects (Paulstretch) may need to generate more
|
|
|
|
// than previewLen, so take the min.
|
|
|
|
t1 = std::min(mT0 + previewLen, mT1);
|
2013-02-15 00:24:43 +00:00
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
// Start audio playing
|
2019-06-28 12:50:47 +00:00
|
|
|
AudioIOStartStreamOptions options { ::GetActiveProject(), rate };
|
2016-12-16 18:27:24 +00:00
|
|
|
int token =
|
2018-05-29 00:44:37 +00:00
|
|
|
gAudioIO->StartStream(tracks, mT0, t1, options);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
if (token) {
|
|
|
|
auto previewing = ProgressResult::Success;
|
|
|
|
// The progress dialog must be deleted before stopping the stream
|
|
|
|
// to allow events to flow to the app during StopStream processing.
|
|
|
|
// The progress dialog blocks these events.
|
|
|
|
{
|
|
|
|
ProgressDialog progress
|
2019-12-19 16:44:00 +00:00
|
|
|
(GetName(), XO("Previewing"), pdlgHideCancelButton);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
while (gAudioIO->IsStreamActive(token) && previewing == ProgressResult::Success) {
|
2016-08-16 17:30:26 +00:00
|
|
|
::wxMilliSleep(100);
|
2016-12-16 18:27:24 +00:00
|
|
|
previewing = progress.Update(gAudioIO->GetStreamTime() - mT0, t1 - mT0);
|
2016-08-16 17:30:26 +00:00
|
|
|
}
|
|
|
|
}
|
2016-12-16 18:27:24 +00:00
|
|
|
|
|
|
|
gAudioIO->StopStream();
|
|
|
|
|
|
|
|
while (gAudioIO->IsBusy()) {
|
|
|
|
::wxMilliSleep(100);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
}
|
2016-12-16 18:27:24 +00:00
|
|
|
else {
|
2019-12-08 05:25:47 +00:00
|
|
|
ShowErrorDialog(FocusDialog, XO("Error"),
|
2019-12-05 18:38:07 +00:00
|
|
|
XO("Error opening sound device.\nTry changing the audio host, playback device and the project sample rate."),
|
2017-09-06 12:19:42 +00:00
|
|
|
wxT("Error_opening_sound_device"));
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
2015-05-15 11:47:51 +00:00
|
|
|
}
|
2014-11-03 06:48:54 +00:00
|
|
|
}
|
|
|
|
|
2019-12-19 19:19:51 +00:00
|
|
|
int Effect::MessageBox( const TranslatableString& message,
|
|
|
|
long style, const TranslatableString &titleStr)
|
2017-09-07 03:35:54 +00:00
|
|
|
{
|
2019-12-19 19:19:51 +00:00
|
|
|
auto title = titleStr.empty()
|
|
|
|
? GetName()
|
|
|
|
: XO("%s: %s").Format( GetName(), titleStr );
|
2019-12-07 19:30:07 +00:00
|
|
|
return AudacityMessageBox( message, title, style, mUIParent );
|
2017-09-07 03:35:54 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 21:10:50 +00:00
|
|
|
BEGIN_EVENT_TABLE(EffectDialog, wxDialogWrapper)
|
2014-12-12 08:53:28 +00:00
|
|
|
EVT_BUTTON(wxID_OK, EffectDialog::OnOk)
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
EffectDialog::EffectDialog(wxWindow * parent,
|
2019-12-08 05:25:47 +00:00
|
|
|
const TranslatableString & title,
|
2010-01-23 19:44:49 +00:00
|
|
|
int type,
|
2013-05-02 23:41:27 +00:00
|
|
|
int flags,
|
|
|
|
int additionalButtons)
|
2016-07-10 21:10:50 +00:00
|
|
|
: wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
mType = type;
|
2013-05-02 23:41:27 +00:00
|
|
|
mAdditionalButtons = additionalButtons;
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void EffectDialog::Init()
|
|
|
|
{
|
2018-01-31 01:03:46 +00:00
|
|
|
long buttons = eOkButton;
|
|
|
|
if ((mType != EffectTypeAnalyze) && (mType != EffectTypeTool))
|
|
|
|
{
|
|
|
|
buttons |= eCancelButton;
|
|
|
|
if (mType == EffectTypeProcess)
|
|
|
|
{
|
|
|
|
buttons |= ePreviewButton;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
ShuttleGui S(this, eIsCreating);
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
S.SetBorder(5);
|
|
|
|
S.StartVerticalLay(true);
|
|
|
|
{
|
|
|
|
PopulateOrExchange(S);
|
2013-05-02 23:41:27 +00:00
|
|
|
S.AddStandardButtons(buttons|mAdditionalButtons);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
S.EndVerticalLay();
|
|
|
|
|
|
|
|
Layout();
|
|
|
|
Fit();
|
|
|
|
SetMinSize(GetSize());
|
|
|
|
Center();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// This is a virtual function which will be overridden to
|
|
|
|
/// provide the actual parameters that we want for each
|
|
|
|
/// kind of dialog.
|
2013-08-25 21:51:26 +00:00
|
|
|
void EffectDialog::PopulateOrExchange(ShuttleGui & WXUNUSED(S))
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectDialog::TransferDataToWindow()
|
|
|
|
{
|
|
|
|
ShuttleGui S(this, eIsSettingToDialog);
|
|
|
|
PopulateOrExchange(S);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectDialog::TransferDataFromWindow()
|
|
|
|
{
|
|
|
|
ShuttleGui S(this, eIsGettingFromDialog);
|
|
|
|
PopulateOrExchange(S);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectDialog::Validate()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
void EffectDialog::OnPreview(wxCommandEvent & WXUNUSED(evt))
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
void EffectDialog::OnOk(wxCommandEvent & WXUNUSED(evt))
|
2014-12-12 08:53:28 +00:00
|
|
|
{
|
|
|
|
// On wxGTK (wx2.8.12), the default action is still executed even if
|
|
|
|
// the button is disabled. This appears to affect all wxDialogs, not
|
|
|
|
// just our Effects dialogs. So, this is a only temporary workaround
|
|
|
|
// for legacy effects that disable the OK button. Hopefully this has
|
|
|
|
// been corrected in wx3.
|
2015-05-15 23:50:08 +00:00
|
|
|
if (FindWindow(wxID_OK)->IsEnabled() && Validate() && TransferDataFromWindow())
|
2014-12-12 08:53:28 +00:00
|
|
|
{
|
|
|
|
EndModal(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-04-26 21:41:05 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// EffectPresetsDialog
|
|
|
|
//
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ID_Type = 10000
|
|
|
|
};
|
|
|
|
|
2016-07-10 21:10:50 +00:00
|
|
|
BEGIN_EVENT_TABLE(EffectPresetsDialog, wxDialogWrapper)
|
2015-04-26 21:41:05 +00:00
|
|
|
EVT_CHOICE(ID_Type, EffectPresetsDialog::OnType)
|
|
|
|
EVT_LISTBOX_DCLICK(wxID_ANY, EffectPresetsDialog::OnOk)
|
|
|
|
EVT_BUTTON(wxID_OK, EffectPresetsDialog::OnOk)
|
|
|
|
EVT_BUTTON(wxID_CANCEL, EffectPresetsDialog::OnCancel)
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
EffectPresetsDialog::EffectPresetsDialog(wxWindow *parent, Effect *effect)
|
2019-12-08 05:25:47 +00:00
|
|
|
: wxDialogWrapper(parent, wxID_ANY, XO("Select Preset"))
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
ShuttleGui S(this, eIsCreating);
|
|
|
|
S.StartVerticalLay();
|
|
|
|
{
|
|
|
|
S.StartTwoColumn();
|
|
|
|
S.SetStretchyCol(1);
|
|
|
|
{
|
2019-12-22 20:40:29 +00:00
|
|
|
S.AddPrompt(XO("Type:"));
|
2018-02-02 00:23:02 +00:00
|
|
|
mType = S.Id(ID_Type).AddChoice( {}, {}, 0 );
|
2015-04-26 21:41:05 +00:00
|
|
|
|
2019-12-22 20:40:29 +00:00
|
|
|
S.AddPrompt(XO("&Preset:"));
|
2019-11-18 02:24:01 +00:00
|
|
|
mPresets = S
|
|
|
|
.Style( wxLB_SINGLE | wxLB_NEEDED_SB )
|
|
|
|
.AddListBox( {} );
|
2015-04-26 21:41:05 +00:00
|
|
|
}
|
|
|
|
S.EndTwoColumn();
|
|
|
|
|
|
|
|
S.AddStandardButtons();
|
|
|
|
}
|
|
|
|
S.EndVerticalLay();
|
|
|
|
|
|
|
|
mUserPresets = effect->GetUserPresets();
|
|
|
|
mFactoryPresets = effect->GetFactoryPresets();
|
|
|
|
|
2019-02-12 00:10:48 +00:00
|
|
|
if (mUserPresets.size() > 0)
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
mType->Append(_("User Presets"));
|
|
|
|
}
|
|
|
|
|
2019-02-12 00:10:48 +00:00
|
|
|
if (mFactoryPresets.size() > 0)
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
mType->Append(_("Factory Presets"));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (effect->HasCurrentSettings())
|
|
|
|
{
|
|
|
|
mType->Append(_("Current Settings"));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (effect->HasFactoryDefaults())
|
|
|
|
{
|
|
|
|
mType->Append(_("Factory Defaults"));
|
|
|
|
}
|
|
|
|
|
|
|
|
UpdateUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectPresetsDialog::~EffectPresetsDialog()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-04-27 10:02:56 +00:00
|
|
|
wxString EffectPresetsDialog::GetSelected() const
|
|
|
|
{
|
|
|
|
return mSelection;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectPresetsDialog::SetSelected(const wxString & parms)
|
|
|
|
{
|
|
|
|
wxString preset = parms;
|
|
|
|
if (preset.StartsWith(Effect::kUserPresetIdent))
|
|
|
|
{
|
|
|
|
preset.Replace(Effect::kUserPresetIdent, wxEmptyString, false);
|
2019-12-29 05:01:57 +00:00
|
|
|
SetPrefix(XO("User Presets"), preset);
|
2015-04-27 10:02:56 +00:00
|
|
|
}
|
|
|
|
else if (preset.StartsWith(Effect::kFactoryPresetIdent))
|
|
|
|
{
|
|
|
|
preset.Replace(Effect::kFactoryPresetIdent, wxEmptyString, false);
|
2019-12-29 05:01:57 +00:00
|
|
|
SetPrefix(XO("Factory Presets"), preset);
|
2015-04-27 10:02:56 +00:00
|
|
|
}
|
|
|
|
else if (preset.StartsWith(Effect::kCurrentSettingsIdent))
|
|
|
|
{
|
2019-12-29 05:01:57 +00:00
|
|
|
SetPrefix(XO("Current Settings"), wxEmptyString);
|
2015-04-27 10:02:56 +00:00
|
|
|
}
|
|
|
|
else if (preset.StartsWith(Effect::kFactoryDefaultsIdent))
|
|
|
|
{
|
2019-12-29 05:01:57 +00:00
|
|
|
SetPrefix(XO("Factory Defaults"), wxEmptyString);
|
2015-04-27 10:02:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-29 05:01:57 +00:00
|
|
|
void EffectPresetsDialog::SetPrefix(
|
|
|
|
const TranslatableString & type, const wxString & prefix)
|
2015-04-27 10:02:56 +00:00
|
|
|
{
|
2019-12-29 05:01:57 +00:00
|
|
|
mType->SetStringSelection(type.Translation());
|
2015-04-27 10:02:56 +00:00
|
|
|
|
2019-12-29 05:01:57 +00:00
|
|
|
if (type == XO("User Presets"))
|
2015-04-27 10:02:56 +00:00
|
|
|
{
|
|
|
|
mPresets->Clear();
|
2019-03-01 17:20:51 +00:00
|
|
|
for (const auto &preset : mUserPresets)
|
|
|
|
mPresets->Append(preset);
|
2015-04-27 10:02:56 +00:00
|
|
|
mPresets->Enable(true);
|
|
|
|
mPresets->SetStringSelection(prefix);
|
|
|
|
if (mPresets->GetSelection() == wxNOT_FOUND)
|
|
|
|
{
|
|
|
|
mPresets->SetSelection(0);
|
|
|
|
}
|
|
|
|
mSelection = Effect::kUserPresetIdent + mPresets->GetStringSelection();
|
|
|
|
}
|
2019-12-29 05:01:57 +00:00
|
|
|
else if (type == XO("Factory Presets"))
|
2015-04-27 10:02:56 +00:00
|
|
|
{
|
|
|
|
mPresets->Clear();
|
2019-02-12 00:10:48 +00:00
|
|
|
for (size_t i = 0, cnt = mFactoryPresets.size(); i < cnt; i++)
|
2015-04-27 10:02:56 +00:00
|
|
|
{
|
2019-03-01 17:20:51 +00:00
|
|
|
auto label = mFactoryPresets[i];
|
2019-02-12 00:10:48 +00:00
|
|
|
if (label.empty())
|
2015-04-27 10:02:56 +00:00
|
|
|
{
|
|
|
|
label = _("None");
|
|
|
|
}
|
|
|
|
mPresets->Append(label);
|
|
|
|
}
|
|
|
|
mPresets->Enable(true);
|
|
|
|
mPresets->SetStringSelection(prefix);
|
|
|
|
if (mPresets->GetSelection() == wxNOT_FOUND)
|
|
|
|
{
|
|
|
|
mPresets->SetSelection(0);
|
|
|
|
}
|
|
|
|
mSelection = Effect::kFactoryPresetIdent + mPresets->GetStringSelection();
|
|
|
|
}
|
2019-12-29 05:01:57 +00:00
|
|
|
else if (type == XO("Current Settings"))
|
2015-04-27 10:02:56 +00:00
|
|
|
{
|
|
|
|
mPresets->Clear();
|
|
|
|
mPresets->Enable(false);
|
|
|
|
mSelection = Effect::kCurrentSettingsIdent;
|
|
|
|
}
|
2019-12-29 05:01:57 +00:00
|
|
|
else if (type == XO("Factory Defaults"))
|
2015-04-27 10:02:56 +00:00
|
|
|
{
|
|
|
|
mPresets->Clear();
|
|
|
|
mPresets->Enable(false);
|
|
|
|
mSelection = Effect::kFactoryDefaultsIdent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-26 21:41:05 +00:00
|
|
|
void EffectPresetsDialog::UpdateUI()
|
|
|
|
{
|
|
|
|
int selected = mType->GetSelection();
|
|
|
|
if (selected == wxNOT_FOUND)
|
|
|
|
{
|
|
|
|
selected = 0;
|
|
|
|
mType->SetSelection(selected);
|
|
|
|
}
|
|
|
|
wxString type = mType->GetString(selected);
|
|
|
|
|
2019-02-28 13:54:36 +00:00
|
|
|
if (type == _("User Presets"))
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
selected = mPresets->GetSelection();
|
|
|
|
if (selected == wxNOT_FOUND)
|
|
|
|
{
|
|
|
|
selected = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
mPresets->Clear();
|
2019-03-01 17:20:51 +00:00
|
|
|
for (const auto &preset : mUserPresets)
|
|
|
|
mPresets->Append(preset);
|
2015-04-26 21:41:05 +00:00
|
|
|
mPresets->Enable(true);
|
|
|
|
mPresets->SetSelection(selected);
|
|
|
|
mSelection = Effect::kUserPresetIdent + mPresets->GetString(selected);
|
|
|
|
}
|
2019-02-28 13:54:36 +00:00
|
|
|
else if (type == _("Factory Presets"))
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
selected = mPresets->GetSelection();
|
|
|
|
if (selected == wxNOT_FOUND)
|
|
|
|
{
|
|
|
|
selected = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
mPresets->Clear();
|
2019-02-12 00:10:48 +00:00
|
|
|
for (size_t i = 0, cnt = mFactoryPresets.size(); i < cnt; i++)
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
2019-03-01 17:20:51 +00:00
|
|
|
auto label = mFactoryPresets[i];
|
2019-02-12 00:10:48 +00:00
|
|
|
if (label.empty())
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
label = _("None");
|
|
|
|
}
|
|
|
|
mPresets->Append(label);
|
|
|
|
}
|
|
|
|
mPresets->Enable(true);
|
|
|
|
mPresets->SetSelection(selected);
|
|
|
|
mSelection = Effect::kFactoryPresetIdent + mPresets->GetString(selected);
|
|
|
|
}
|
2019-02-28 13:54:36 +00:00
|
|
|
else if (type == _("Current Settings"))
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
mPresets->Clear();
|
|
|
|
mPresets->Enable(false);
|
|
|
|
mSelection = Effect::kCurrentSettingsIdent;
|
|
|
|
}
|
2019-02-28 13:54:36 +00:00
|
|
|
else if (type == _("Factory Defaults"))
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
mPresets->Clear();
|
|
|
|
mPresets->Enable(false);
|
|
|
|
mSelection = Effect::kFactoryDefaultsIdent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectPresetsDialog::OnType(wxCommandEvent & WXUNUSED(evt))
|
|
|
|
{
|
|
|
|
UpdateUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectPresetsDialog::OnOk(wxCommandEvent & WXUNUSED(evt))
|
|
|
|
{
|
|
|
|
UpdateUI();
|
|
|
|
|
|
|
|
EndModal(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectPresetsDialog::OnCancel(wxCommandEvent & WXUNUSED(evt))
|
|
|
|
{
|
|
|
|
mSelection = wxEmptyString;
|
|
|
|
|
|
|
|
EndModal(false);
|
|
|
|
}
|