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
|
|
|
|
2016-01-21 15:41:03 +00:00
|
|
|
#include <algorithm>
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
#include <wx/defs.h>
|
2015-04-27 18:16:08 +00:00
|
|
|
#include <wx/hashmap.h>
|
2010-01-23 19:44:49 +00:00
|
|
|
#include <wx/sizer.h>
|
2015-04-27 18:16:08 +00:00
|
|
|
#include <wx/stockitem.h>
|
|
|
|
#include <wx/string.h>
|
2014-12-02 08:55:02 +00:00
|
|
|
#include <wx/tglbtn.h>
|
2015-04-27 18:16:08 +00:00
|
|
|
#include <wx/timer.h>
|
2014-12-12 14:44:50 +00:00
|
|
|
#include <wx/utils.h>
|
2015-05-28 16:31:07 +00:00
|
|
|
#include <wx/log.h>
|
2010-01-23 19:44:49 +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
|
|
|
#include "audacity/ConfigInterface.h"
|
|
|
|
|
2016-11-07 21:34:14 +00:00
|
|
|
#include "../AudacityException.h"
|
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"
|
|
|
|
#include "../Prefs.h"
|
|
|
|
#include "../Project.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"
|
2010-01-23 19:44:49 +00:00
|
|
|
#include "../WaveTrack.h"
|
2014-12-04 06:10:27 +00:00
|
|
|
#include "../toolbars/ControlToolBar.h"
|
2014-12-02 08:55:02 +00:00
|
|
|
#include "../widgets/AButton.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
#include "../widgets/ProgressDialog.h"
|
|
|
|
#include "../ondemand/ODManager.h"
|
|
|
|
#include "TimeWarper.h"
|
2015-05-28 16:31:07 +00:00
|
|
|
#include "nyquist/Nyquist.h"
|
2017-05-15 21:00:33 +00:00
|
|
|
#include "../widgets/HelpSystem.h"
|
2017-05-20 16:11:02 +00:00
|
|
|
#include "../widgets/LinkingHtmlWindow.h"
|
2017-10-06 15:05:15 +00:00
|
|
|
#include "../widgets/NumericTextCtrl.h"
|
2017-05-20 16:11:02 +00:00
|
|
|
#include "../widgets/ErrorDialog.h"
|
|
|
|
#include "../FileNames.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 "../commands/AudacityCommand.h"
|
|
|
|
#include "../commands/CommandContext.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-07-12 00:33:04 +00:00
|
|
|
#if defined(__WXMAC__)
|
|
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
#endif
|
|
|
|
|
2015-08-31 19:50:50 +00:00
|
|
|
#include "../Experimental.h"
|
2017-06-04 15:52:17 +00:00
|
|
|
#include "../commands/ScreenshotCommand.h"
|
2015-08-31 19:50:50 +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 kDummyID = 20000;
|
|
|
|
static const int kSaveAsID = 20001;
|
|
|
|
static const int kImportID = 20002;
|
|
|
|
static const int kExportID = 20003;
|
|
|
|
static const int kDefaultsID = 20004;
|
|
|
|
static const int kOptionsID = 20005;
|
|
|
|
static const int kUserPresetsDummyID = 20006;
|
|
|
|
static const int kDeletePresetDummyID = 20007;
|
|
|
|
static const int kMenuID = 20100;
|
|
|
|
static const int kEnableID = 20101;
|
|
|
|
static const int kPlayID = 20102;
|
|
|
|
static const int kRewindID = 20103;
|
|
|
|
static const int kFFwdID = 20104;
|
|
|
|
static const int kPlaybackID = 20105;
|
|
|
|
static const int kCaptureID = 20106;
|
|
|
|
static const int kUserPresetsID = 21000;
|
|
|
|
static const int kDeletePresetID = 22000;
|
|
|
|
static const int kFactoryPresetsID = 23000;
|
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
|
|
|
|
|
|
|
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;
|
|
|
|
mOutputTracksType = Track::None;
|
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
|
|
|
|
2014-12-13 18:24:11 +00:00
|
|
|
mRealtimeSuspendLock.Enter();
|
|
|
|
mRealtimeSuspendCount = 1; // Effects are initially suspended
|
|
|
|
mRealtimeSuspendLock.Leave();
|
|
|
|
|
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();
|
|
|
|
mProjectRate = p ? 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString Effect::GetPath()
|
|
|
|
{
|
|
|
|
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-03-09 18:11:20 +00:00
|
|
|
IdentInterfaceSymbol 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
|
|
|
}
|
|
|
|
|
2018-03-29 18:56:52 +00:00
|
|
|
IdentInterfaceSymbol 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
|
|
|
}
|
|
|
|
|
|
|
|
wxString Effect::GetDescription()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetDescription();
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
return wxEmptyString;
|
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
|
|
|
IdentInterfaceSymbol Effect::GetFamilyId()
|
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)
|
|
|
|
{
|
2018-01-16 04:40:42 +00:00
|
|
|
return mClient->GetFamilyId();
|
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
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::IsLegacy()
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::RealtimeSuspend()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
if (mClient->RealtimeSuspend())
|
|
|
|
{
|
|
|
|
mRealtimeSuspendLock.Enter();
|
|
|
|
mRealtimeSuspendCount++;
|
|
|
|
mRealtimeSuspendLock.Leave();
|
|
|
|
return true;
|
|
|
|
}
|
2015-08-01 12:03:02 +00:00
|
|
|
|
|
|
|
return false;
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
|
|
|
|
2015-08-01 12:03:02 +00:00
|
|
|
mRealtimeSuspendLock.Enter();
|
|
|
|
mRealtimeSuspendCount++;
|
|
|
|
mRealtimeSuspendLock.Leave();
|
|
|
|
|
|
|
|
return true;
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::RealtimeResume()
|
|
|
|
{
|
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
if (mClient->RealtimeResume())
|
|
|
|
{
|
|
|
|
mRealtimeSuspendLock.Enter();
|
|
|
|
mRealtimeSuspendCount--;
|
|
|
|
mRealtimeSuspendLock.Leave();
|
|
|
|
return true;
|
|
|
|
}
|
2015-08-01 12:03:02 +00:00
|
|
|
|
|
|
|
return false;
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
|
|
|
|
2015-08-01 12:03:02 +00:00
|
|
|
mRealtimeSuspendLock.Enter();
|
|
|
|
mRealtimeSuspendCount--;
|
|
|
|
mRealtimeSuspendLock.Leave();
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::ShowInterface(wxWindow *parent, bool forceModal)
|
|
|
|
{
|
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)
|
|
|
|
{
|
|
|
|
return mClient->ShowInterface(parent, forceModal);
|
|
|
|
}
|
|
|
|
|
2016-12-16 20:32:56 +00:00
|
|
|
// mUIDialog is null
|
|
|
|
auto cleanup = valueRestorer( mUIDialog );
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
mUIDialog = CreateUI(parent, this);
|
|
|
|
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());
|
|
|
|
|
2017-06-04 15:52:17 +00:00
|
|
|
if( ScreenshotCommand::MayCapture( mUIDialog ) )
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::LoadUserPreset(const wxString & name)
|
|
|
|
{
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::SaveUserPreset(const wxString & name)
|
|
|
|
{
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
wxArrayString Effect::GetFactoryPresets()
|
|
|
|
{
|
2015-04-23 13:04:32 +00:00
|
|
|
if (mClient)
|
|
|
|
{
|
|
|
|
return mClient->GetFactoryPresets();
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
return wxArrayString();
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2017-10-06 15:05:15 +00:00
|
|
|
NumericFormatId Effect::GetDurationFormat()
|
2015-05-27 13:42:15 +00:00
|
|
|
{
|
|
|
|
return mDurationFormat;
|
|
|
|
}
|
|
|
|
|
2017-10-06 15:05:15 +00:00
|
|
|
NumericFormatId Effect::GetSelectionFormat()
|
2015-07-18 17:31:36 +00:00
|
|
|
{
|
|
|
|
return GetActiveProject()->GetSelectionFormat();
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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::Apply()
|
|
|
|
{
|
2017-08-20 04:16:22 +00:00
|
|
|
auto &project = *GetActiveProject();
|
|
|
|
CommandContext context( project );
|
2015-04-17 03:53:42 +00:00
|
|
|
// This is absolute hackage...but easy and I can't think of another way just now.
|
2014-11-07 09:54:04 +00:00
|
|
|
//
|
|
|
|
// It should callback to the EffectManager to kick off the processing
|
2017-08-20 04:16:22 +00:00
|
|
|
return GetMenuCommandHandler(project).DoEffect(GetID(), context,
|
|
|
|
MenuCommandHandler::OnEffectFlags::kConfigured);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
void Effect::Preview()
|
|
|
|
{
|
|
|
|
Preview(false);
|
|
|
|
}
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
wxDialog *Effect::CreateUI(wxWindow *parent, EffectUIClientInterface *client)
|
|
|
|
{
|
2016-08-10 02:46:59 +00:00
|
|
|
Destroy_ptr<EffectUIHost> dlg
|
|
|
|
{ safenew EffectUIHost{ parent, this, client} };
|
2014-11-14 03:03:17 +00:00
|
|
|
|
|
|
|
if (dlg->Initialize())
|
|
|
|
{
|
2016-08-10 02:46:59 +00:00
|
|
|
// release() is safe because parent will own it
|
|
|
|
return dlg.release();
|
2014-11-14 03:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString Effect::GetUserPresetsGroup(const wxString & name)
|
|
|
|
{
|
|
|
|
wxString group = wxT("UserPresets");
|
|
|
|
if (!name.IsEmpty())
|
|
|
|
{
|
|
|
|
group += wxCONFIG_PATH_SEPARATOR + name;
|
|
|
|
}
|
|
|
|
|
|
|
|
return group;
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString Effect::GetCurrentSettingsGroup()
|
|
|
|
{
|
|
|
|
return wxT("CurrentSettings");
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString Effect::GetFactoryDefaultsGroup()
|
|
|
|
{
|
|
|
|
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
|
2015-04-26 21:41:05 +00:00
|
|
|
bool Effect::HasSharedConfigGroup(const wxString & group)
|
|
|
|
{
|
|
|
|
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
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
bool Effect::GetSharedConfigSubgroups(const wxString & group, wxArrayString & subgroups)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfigSubgroups(GetID(), group, subgroups);
|
|
|
|
}
|
|
|
|
|
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::GetSharedConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::GetSharedConfig(const wxString & group, const wxString & key, int & value, int defval)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::GetSharedConfig(const wxString & group, const wxString & key, bool & value, bool defval)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::GetSharedConfig(const wxString & group, const wxString & key, float & value, float defval)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::GetSharedConfig(const wxString & group, const wxString & key, double & value, double defval)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::SetSharedConfig(const wxString & group, const wxString & key, const wxString & value)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::SetSharedConfig(const wxString & group, const wxString & key, const int & value)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::SetSharedConfig(const wxString & group, const wxString & key, const bool & value)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::SetSharedConfig(const wxString & group, const wxString & key, const float & value)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::SetSharedConfig(const wxString & group, const wxString & key, const double & value)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
bool Effect::RemoveSharedConfigSubgroup(const wxString & group)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().RemoveSharedConfigSubgroup(GetID(), group);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::RemoveSharedConfig(const wxString & group, const wxString & key)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().RemoveSharedConfig(GetID(), group, key);
|
|
|
|
}
|
|
|
|
|
2015-04-26 21:41:05 +00:00
|
|
|
bool Effect::HasPrivateConfigGroup(const wxString & group)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().HasPrivateConfigGroup(GetID(), group);
|
|
|
|
}
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
bool Effect::GetPrivateConfigSubgroups(const wxString & group, wxArrayString & subgroups)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfigSubgroups(GetID(), group, subgroups);
|
|
|
|
}
|
|
|
|
|
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::GetPrivateConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::GetPrivateConfig(const wxString & group, const wxString & key, int & value, int defval)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::GetPrivateConfig(const wxString & group, const wxString & key, bool & value, bool defval)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::GetPrivateConfig(const wxString & group, const wxString & key, float & value, float defval)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::GetPrivateConfig(const wxString & group, const wxString & key, double & value, double defval)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::SetPrivateConfig(const wxString & group, const wxString & key, const wxString & value)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::SetPrivateConfig(const wxString & group, const wxString & key, const int & value)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::SetPrivateConfig(const wxString & group, const wxString & key, const bool & value)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::SetPrivateConfig(const wxString & group, const wxString & key, const float & value)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::SetPrivateConfig(const wxString & group, const wxString & key, const double & value)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
|
|
|
|
}
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
bool Effect::RemovePrivateConfigSubgroup(const wxString & group)
|
|
|
|
{
|
|
|
|
return PluginManager::Get().RemovePrivateConfigSubgroup(GetID(), group);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Effect::RemovePrivateConfig(const wxString & group, const wxString & key)
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
wxArrayString presets = GetFactoryPresets();
|
|
|
|
success = LoadFactoryPreset(presets.Index(preset));
|
|
|
|
}
|
|
|
|
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(
|
2015-04-17 03:53:42 +00:00
|
|
|
wxString::Format(
|
2016-03-09 21:20:54 +00:00
|
|
|
_("%s: Could not load settings below. Default settings will be used.\n\n%s"),
|
2017-10-09 05:03:14 +00:00
|
|
|
GetTranslatedName(),
|
|
|
|
preset
|
2015-04-17 03:53:42 +00:00
|
|
|
)
|
|
|
|
);
|
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
|
|
|
}
|
|
|
|
|
2015-04-26 21:41:05 +00:00
|
|
|
wxArrayString Effect::GetUserPresets()
|
|
|
|
{
|
|
|
|
wxArrayString presets;
|
|
|
|
|
|
|
|
GetPrivateConfigSubgroups(GetUserPresetsGroup(wxEmptyString), presets);
|
|
|
|
|
|
|
|
presets.Sort();
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
bool Effect::DoEffect(wxWindow *parent,
|
2010-01-23 19:44:49 +00:00
|
|
|
double projectRate,
|
|
|
|
TrackList *list,
|
|
|
|
TrackFactory *factory,
|
2015-04-17 03:53:42 +00:00
|
|
|
SelectedRegion *selectedRegion,
|
|
|
|
bool shouldPrompt /* = true */)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2015-04-18 03:52:34 +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-07 19:24:31 +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 );
|
|
|
|
} );
|
|
|
|
|
|
|
|
if ((GetType() == EffectTypeGenerate) && (mNumTracks == 0) && GetPath() != NYQUIST_EFFECTS_PROMPT_ID) {
|
|
|
|
newTrack = static_cast<WaveTrack*>(mTracks->Add(mFactory->NewWaveTrack()));
|
|
|
|
newTrack->SetSelected(true);
|
|
|
|
}
|
|
|
|
|
2015-04-18 03:52:34 +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-08-21 12:11:41 +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
|
|
|
|
mF0 = selectedRegion->f0();
|
|
|
|
mF1 = selectedRegion->f1();
|
2014-10-24 20:27:04 +00:00
|
|
|
wxArrayString Names;
|
|
|
|
if( mF0 != SelectedRegion::UndefinedFrequency )
|
|
|
|
Names.Add(wxT("control-f0"));
|
|
|
|
if( mF1 != SelectedRegion::UndefinedFrequency )
|
|
|
|
Names.Add(wxT("control-f1"));
|
|
|
|
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
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// Prompting will be bypassed when applying an effect that has already
|
|
|
|
// 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
|
2015-04-26 21:41:05 +00:00
|
|
|
if (shouldPrompt && IsInteractive() && !PromptUser(parent))
|
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)
|
|
|
|
{
|
2017-09-07 03:35:54 +00:00
|
|
|
auto name = GetTranslatedName();
|
2016-12-16 18:27:24 +00:00
|
|
|
ProgressDialog progress{
|
2017-09-07 03:35:54 +00:00
|
|
|
name,
|
2017-10-09 05:03:14 +00:00
|
|
|
wxString::Format(_("Applying %s..."), 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
|
|
|
{
|
2014-10-05 17:10:09 +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;
|
|
|
|
}
|
|
|
|
|
2018-02-07 19:24:31 +00:00
|
|
|
bool Effect::Delegate( Effect &delegate, wxWindow *parent, bool shouldPrompt)
|
2016-12-29 15:36:37 +00:00
|
|
|
{
|
|
|
|
return delegate.DoEffect( parent, mProjectRate, mTracks, mFactory,
|
2018-02-07 19:24:31 +00:00
|
|
|
mpSelectedRegion, shouldPrompt );
|
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-26 21:41:05 +00:00
|
|
|
// Remove this method once NoiseReduction gets migrated
|
|
|
|
bool Effect::PromptUser(wxWindow *parent)
|
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
|
|
|
return ShowInterface(parent, IsBatchProcessing());
|
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
|
|
|
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()
|
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
CopyInputTracks(Track::All);
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +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
|
|
|
WaveTrack *right;
|
|
|
|
sampleCount len;
|
|
|
|
sampleCount leftStart;
|
|
|
|
sampleCount rightStart;
|
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-11 21:55:19 +00:00
|
|
|
mNumChannels = 1;
|
|
|
|
|
|
|
|
if (left->GetChannel() == Track::LeftChannel)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
2017-04-11 21:55:19 +00:00
|
|
|
map[0] = ChannelNameFrontLeft;
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
2017-04-11 21:55:19 +00:00
|
|
|
else if (left->GetChannel() == Track::RightChannel)
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
2017-04-11 21:55:19 +00:00
|
|
|
map[0] = ChannelNameFrontRight;
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-04-11 21:55:19 +00:00
|
|
|
map[0] = ChannelNameMono;
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
2017-04-11 21:55:19 +00:00
|
|
|
map[1] = 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-11 21:55:19 +00:00
|
|
|
right = NULL;
|
|
|
|
rightStart = 0;
|
|
|
|
if (left->GetLinked() && multichannel)
|
|
|
|
{
|
|
|
|
// Assume linked track is wave
|
|
|
|
right = static_cast<WaveTrack *>(left->GetLink());
|
|
|
|
if (!isGenerator)
|
|
|
|
{
|
|
|
|
GetSamples(right, &rightStart, &len);
|
|
|
|
}
|
|
|
|
clear = false;
|
|
|
|
mNumChannels = 2;
|
|
|
|
|
|
|
|
if (right->GetChannel() == Track::LeftChannel)
|
|
|
|
{
|
|
|
|
map[1] = ChannelNameFrontLeft;
|
|
|
|
}
|
|
|
|
else if (right->GetChannel() == Track::RightChannel)
|
|
|
|
{
|
|
|
|
map[1] = ChannelNameFrontRight;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
map[1] = ChannelNameMono;
|
|
|
|
}
|
|
|
|
map[2] = 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-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
|
|
|
|
// effect with an empty input buffer until the effect has had a chance to
|
|
|
|
// 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
|
|
|
|
2016-03-02 19:59:31 +00:00
|
|
|
std::unique_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
|
|
|
genLeft->SetWaveColorIndex( left->GetWaveColorIndex() );
|
|
|
|
|
2014-11-07 09:54:04 +00:00
|
|
|
if (right)
|
|
|
|
{
|
|
|
|
genRight = mFactory->NewWaveTrack(right->GetSampleFormat(), right->GetRate());
|
2017-11-04 17:09:01 +00:00
|
|
|
genRight->SetWaveColorIndex( right->GetWaveColorIndex() );
|
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
|
|
|
// 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)
|
|
|
|
{
|
|
|
|
// 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
|
|
|
{
|
2016-08-24 15:24:26 +00:00
|
|
|
auto delay = GetLatency();
|
2014-11-07 09:54:04 +00:00
|
|
|
curDelay += delay;
|
|
|
|
delayRemaining += delay;
|
|
|
|
|
|
|
|
// 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().
|
2016-08-20 22:13:49 +00:00
|
|
|
left->ClearAndPaste(mT0, p->GetSel1(), 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;
|
|
|
|
}
|
|
|
|
|
2018-07-24 15:10:52 +00:00
|
|
|
bool Effect::TotalProgress(double frac, const wxString &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
|
|
|
}
|
|
|
|
|
2016-02-23 02:17:19 +00:00
|
|
|
bool Effect::TrackProgress(int whichTrack, double frac, const wxString &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
|
|
|
}
|
|
|
|
|
2016-02-23 02:17:19 +00:00
|
|
|
bool Effect::TrackGroupProgress(int whichGroup, double frac, const wxString &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
|
|
|
|
//
|
2014-06-03 20:30:19 +00:00
|
|
|
// Use these two methods 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
|
2015-07-03 04:20:21 +00:00
|
|
|
void Effect::CopyInputTracks()
|
|
|
|
{
|
|
|
|
CopyInputTracks(Track::Wave);
|
|
|
|
}
|
|
|
|
|
2017-01-06 18:55:57 +00:00
|
|
|
void Effect::CopyInputTracks(TrackKind trackType)
|
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
|
|
|
|
2017-07-15 01:47:47 +00:00
|
|
|
mOutputTracks = TrackList::Create();
|
2010-01-23 19:44:49 +00:00
|
|
|
mOutputTracksType = trackType;
|
|
|
|
|
|
|
|
//iterate over tracks of type trackType (All types if Track::All)
|
|
|
|
TrackListOfKindIterator aIt(trackType, mTracks);
|
|
|
|
t2bHash added;
|
|
|
|
|
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 (Track *aTrack = aIt.First(); aTrack; aTrack = aIt.Next())
|
|
|
|
{
|
2010-08-11 22:47:26 +00:00
|
|
|
// Include selected tracks, plus sync-lock selected tracks for Track::All.
|
2010-02-16 20:50:38 +00:00
|
|
|
if (aTrack->GetSelected() ||
|
2010-08-11 22:47:26 +00:00
|
|
|
(trackType == Track::All && aTrack->IsSyncLockSelected()))
|
2010-02-16 20:50:38 +00:00
|
|
|
{
|
2016-03-13 15:08:21 +00:00
|
|
|
Track *o = mOutputTracks->Add(aTrack->Duplicate());
|
2016-09-08 15:04:35 +00:00
|
|
|
mIMap.push_back(aTrack);
|
|
|
|
mOMap.push_back(o);
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-13 15:08:21 +00:00
|
|
|
Track *Effect::AddToOutputTracks(std::unique_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());
|
2016-03-13 15:08:21 +00:00
|
|
|
return mOutputTracks->Add(std::move(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);
|
2016-03-13 15:08:21 +00:00
|
|
|
pEffect->mTracks->Add(std::move(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-04-16 16:50:14 +00:00
|
|
|
std::move(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
|
2016-03-13 15:08:21 +00:00
|
|
|
mpEffect->mTracks->Replace(mpTrack, std::move(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
|
|
|
|
2016-12-16 18:27:24 +00:00
|
|
|
mOutputTracksType = Track::None;
|
|
|
|
|
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) {
|
2016-03-13 15:08:21 +00:00
|
|
|
ListOfTracks::value_type o = std::move(*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
|
2016-03-13 15:08:21 +00:00
|
|
|
mTracks->Add(std::move(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-09-21 14:23:05 +00:00
|
|
|
auto newTrack = o.get();
|
2016-03-13 15:08:21 +00:00
|
|
|
mTracks->Replace(t, std::move(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()) {
|
2018-09-21 14:23:05 +00:00
|
|
|
ODManager::Instance()->ReplaceWaveTrack( t, newTrack );
|
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();
|
2010-01-23 19:44:49 +00:00
|
|
|
mOutputTracksType = Track::None;
|
2018-02-24 10:31:50 +00:00
|
|
|
nEffectsDone++;
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Effect::CountWaveTracks()
|
|
|
|
{
|
|
|
|
mNumTracks = 0;
|
|
|
|
mNumGroups = 0;
|
|
|
|
|
|
|
|
TrackListOfKindIterator iter(Track::Wave, mTracks);
|
|
|
|
Track *t = iter.First();
|
|
|
|
|
|
|
|
while(t) {
|
|
|
|
if (!t->GetSelected()) {
|
|
|
|
t = iter.Next();
|
|
|
|
continue;
|
|
|
|
}
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
if (t->GetKind() == Track::Wave) {
|
|
|
|
mNumTracks++;
|
|
|
|
if (!t->GetLinked())
|
|
|
|
mNumGroups++;
|
|
|
|
}
|
|
|
|
t = iter.Next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-15 00:24:43 +00:00
|
|
|
double Effect::CalcPreviewInputLength(double previewLength)
|
|
|
|
{
|
|
|
|
return previewLength;
|
|
|
|
}
|
|
|
|
|
2015-01-02 05:24:43 +00:00
|
|
|
// RealtimeAddProcessor and RealtimeProcess use the same method of
|
|
|
|
// determining the current processor index, so updates to one should
|
|
|
|
// be reflected in the other.
|
2016-09-02 19:53:09 +00:00
|
|
|
bool Effect::RealtimeAddProcessor(int group, unsigned chans, float rate)
|
2015-01-02 05:24:43 +00:00
|
|
|
{
|
2016-09-02 19:53:09 +00:00
|
|
|
auto ichans = chans;
|
|
|
|
auto ochans = chans;
|
|
|
|
auto gchans = chans;
|
2015-01-02 05:24:43 +00:00
|
|
|
|
|
|
|
// Reset processor index
|
|
|
|
if (group == 0)
|
|
|
|
{
|
|
|
|
mCurrentProcessor = 0;
|
2018-02-02 19:49:46 +00:00
|
|
|
mGroupProcessor.clear();
|
2015-01-02 05:24:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Remember the processor starting index
|
2018-02-02 19:49:46 +00:00
|
|
|
mGroupProcessor.push_back(mCurrentProcessor);
|
2015-01-02 05:24:43 +00:00
|
|
|
|
|
|
|
// Call the client until we run out of input or output channels
|
|
|
|
while (ichans > 0 && ochans > 0)
|
|
|
|
{
|
|
|
|
// If we don't have enough input channels to accomodate the client's
|
|
|
|
// requirements, then we replicate the input channels until the
|
|
|
|
// client's needs are met.
|
|
|
|
if (ichans < mNumAudioIn)
|
|
|
|
{
|
|
|
|
// All input channels have been consumed
|
|
|
|
ichans = 0;
|
|
|
|
}
|
|
|
|
// Otherwise fullfil the client's needs with as many input channels as possible.
|
|
|
|
// After calling the client with this set, we will loop back up to process more
|
|
|
|
// of the input/output channels.
|
|
|
|
else if (ichans >= mNumAudioIn)
|
|
|
|
{
|
|
|
|
gchans = mNumAudioIn;
|
|
|
|
ichans -= gchans;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If we don't have enough output channels to accomodate the client's
|
|
|
|
// requirements, then we provide all of the output channels and fulfill
|
|
|
|
// the client's needs with dummy buffers. These will just get tossed.
|
|
|
|
if (ochans < mNumAudioOut)
|
|
|
|
{
|
|
|
|
// All output channels have been consumed
|
|
|
|
ochans = 0;
|
|
|
|
}
|
|
|
|
// Otherwise fullfil the client's needs with as many output channels as possible.
|
|
|
|
// After calling the client with this set, we will loop back up to process more
|
|
|
|
// of the input/output channels.
|
|
|
|
else if (ochans >= mNumAudioOut)
|
|
|
|
{
|
|
|
|
ochans -= mNumAudioOut;
|
|
|
|
}
|
|
|
|
|
2016-02-13 15:43:16 +00:00
|
|
|
// Add a NEW processor
|
2015-08-01 12:03:02 +00:00
|
|
|
RealtimeAddProcessor(gchans, rate);
|
2015-01-02 05:24:43 +00:00
|
|
|
|
|
|
|
// Bump to next processor
|
|
|
|
mCurrentProcessor++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// RealtimeAddProcessor and RealtimeProcess use the same method of
|
|
|
|
// determining the current processor group, so updates to one should
|
|
|
|
// be reflected in the other.
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t Effect::RealtimeProcess(int group,
|
2016-09-02 19:53:09 +00:00
|
|
|
unsigned chans,
|
2014-11-03 06:48:54 +00:00
|
|
|
float **inbuf,
|
|
|
|
float **outbuf,
|
2016-09-06 13:19:27 +00:00
|
|
|
size_t numSamples)
|
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-03 06:48:54 +00:00
|
|
|
//
|
|
|
|
// The caller passes the number of channels to process and specifies
|
|
|
|
// the number of input and output buffers. There will always be the
|
|
|
|
// same number of output buffers as there are input buffers.
|
|
|
|
//
|
|
|
|
// Effects always require a certain number of input and output buffers,
|
|
|
|
// so if the number of channels we're curently processing are different
|
2014-12-13 18:24:11 +00:00
|
|
|
// than what the effect expects, then we use a few methods of satisfying
|
2014-11-03 06:48:54 +00:00
|
|
|
// the effects requirements.
|
|
|
|
float **clientIn = (float **) alloca(mNumAudioIn * sizeof(float *));
|
|
|
|
float **clientOut = (float **) alloca(mNumAudioOut * sizeof(float *));
|
|
|
|
float *dummybuf = (float *) alloca(numSamples * sizeof(float));
|
2016-08-24 15:24:26 +00:00
|
|
|
decltype(numSamples) len = 0;
|
2016-09-02 19:53:09 +00:00
|
|
|
auto ichans = chans;
|
|
|
|
auto ochans = chans;
|
|
|
|
auto gchans = chans;
|
2016-12-23 20:16:07 +00:00
|
|
|
unsigned indx = 0;
|
|
|
|
unsigned ondx = 0;
|
2014-11-03 06:48:54 +00:00
|
|
|
|
2015-01-02 05:24:43 +00:00
|
|
|
int processor = mGroupProcessor[group];
|
2014-11-03 22:47:55 +00:00
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
// Call the client until we run out of input or output channels
|
|
|
|
while (ichans > 0 && ochans > 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-03 06:48:54 +00:00
|
|
|
// If we don't have enough input channels to accomodate the client's
|
|
|
|
// requirements, then we replicate the input channels until the
|
|
|
|
// client's needs are met.
|
|
|
|
if (ichans < mNumAudioIn)
|
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 < mNumAudioIn; i++)
|
2014-11-03 06:48:54 +00:00
|
|
|
{
|
|
|
|
if (indx == ichans)
|
|
|
|
{
|
|
|
|
indx = 0;
|
|
|
|
}
|
|
|
|
clientIn[i] = inbuf[indx++];
|
|
|
|
}
|
|
|
|
|
|
|
|
// All input channels have been consumed
|
|
|
|
ichans = 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-03 06:48:54 +00:00
|
|
|
// Otherwise fullfil the client's needs with as many input channels as possible.
|
|
|
|
// After calling the client with this set, we will loop back up to process more
|
|
|
|
// of the input/output channels.
|
|
|
|
else if (ichans >= mNumAudioIn)
|
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-03 06:48:54 +00:00
|
|
|
gchans = 0;
|
2016-12-23 20:16:07 +00:00
|
|
|
for (size_t i = 0; i < mNumAudioIn; i++, ichans--, gchans++)
|
2014-11-03 06:48:54 +00:00
|
|
|
{
|
|
|
|
clientIn[i] = inbuf[indx++];
|
|
|
|
}
|
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-03 06:48:54 +00:00
|
|
|
// If we don't have enough output channels to accomodate the client's
|
|
|
|
// requirements, then we provide all of the output channels and fulfill
|
|
|
|
// the client's needs with dummy buffers. These will just get tossed.
|
|
|
|
if (ochans < mNumAudioOut)
|
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 < mNumAudioOut; i++)
|
2014-11-03 06:48:54 +00:00
|
|
|
{
|
|
|
|
if (i < ochans)
|
|
|
|
{
|
|
|
|
clientOut[i] = outbuf[i];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
clientOut[i] = dummybuf;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// All output channels have been consumed
|
|
|
|
ochans = 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-03 06:48:54 +00:00
|
|
|
// Otherwise fullfil the client's needs with as many output channels as possible.
|
|
|
|
// After calling the client with this set, we will loop back up to process more
|
|
|
|
// of the input/output channels.
|
|
|
|
else if (ochans >= mNumAudioOut)
|
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 < mNumAudioOut; i++, ochans--)
|
2014-11-03 06:48:54 +00:00
|
|
|
{
|
|
|
|
clientOut[i] = outbuf[ondx++];
|
|
|
|
}
|
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-03 06:48:54 +00:00
|
|
|
|
|
|
|
// Finally call the plugin to process the block
|
2014-11-25 08:08:15 +00:00
|
|
|
len = 0;
|
2016-08-24 15:24:26 +00:00
|
|
|
for (decltype(numSamples) block = 0; block < numSamples; block += mBlockSize)
|
2014-11-25 08:08:15 +00:00
|
|
|
{
|
2016-08-28 20:11:56 +00:00
|
|
|
auto cnt = std::min(numSamples - block, mBlockSize);
|
2015-08-01 12:03:02 +00:00
|
|
|
len += RealtimeProcess(processor, clientIn, clientOut, cnt);
|
2014-11-25 08:08:15 +00:00
|
|
|
|
2016-12-23 20:16:07 +00:00
|
|
|
for (size_t i = 0 ; i < mNumAudioIn; i++)
|
2014-11-25 08:08:15 +00:00
|
|
|
{
|
|
|
|
clientIn[i] += cnt;
|
|
|
|
}
|
|
|
|
|
2016-12-23 20:16:07 +00:00
|
|
|
for (size_t i = 0 ; i < mNumAudioOut; i++)
|
2014-11-25 08:08:15 +00:00
|
|
|
{
|
|
|
|
clientOut[i] += cnt;
|
|
|
|
}
|
|
|
|
}
|
2015-01-02 05:24:43 +00:00
|
|
|
|
|
|
|
// Bump to next processor
|
|
|
|
processor++;
|
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-03 06:48:54 +00:00
|
|
|
return len;
|
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::IsRealtimeActive()
|
2015-01-02 05:24:43 +00:00
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
return mRealtimeSuspendCount == 0;
|
2015-01-02 05:24:43 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
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;
|
2018-03-29 16:28:35 +00:00
|
|
|
bool isNyquist = GetFamilyId() == 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;
|
|
|
|
|
|
|
|
if ((t1 > mT1) && !(isNyquist && 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
|
2017-07-15 01:47:47 +00:00
|
|
|
auto uTracks = TrackList::Create();
|
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);
|
|
|
|
mixLeft->SetDisplay(WaveTrack::NoDisplay);
|
|
|
|
mTracks->Add(std::move(mixLeft));
|
|
|
|
if (mixRight) {
|
|
|
|
mixRight->Offset(-mixRight->GetStartTime());
|
|
|
|
mixRight->SetSelected(true);
|
|
|
|
mTracks->Add(std::move(mixRight));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
TrackListOfKindIterator iter(Track::Wave, saveTracks);
|
|
|
|
WaveTrack *src = (WaveTrack *) iter.First();
|
|
|
|
while (src)
|
2016-08-16 17:30:26 +00:00
|
|
|
{
|
2016-12-16 18:27:24 +00:00
|
|
|
if (src->GetSelected() || mPreviewWithNotSelected) {
|
|
|
|
auto dest = src->Copy(mT0, t1);
|
|
|
|
dest->SetSelected(src->GetSelected());
|
|
|
|
static_cast<WaveTrack*>(dest.get())->SetDisplay(WaveTrack::NoDisplay);
|
|
|
|
mTracks->Add(std::move(dest));
|
2016-08-16 17:30:26 +00:00
|
|
|
}
|
2016-12-16 18:27:24 +00:00
|
|
|
src = (WaveTrack *) iter.Next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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{
|
2017-09-07 03:35:54 +00:00
|
|
|
GetTranslatedName(),
|
2016-12-16 18:27:24 +00:00
|
|
|
_("Preparing preview"),
|
|
|
|
pdlgHideCancelButton
|
|
|
|
}; // Have only "Stop" button.
|
|
|
|
auto vr = valueRestorer( mProgress, &progress );
|
|
|
|
|
|
|
|
auto vr2 = valueRestorer( mIsPreview, true );
|
|
|
|
|
|
|
|
success = Process();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2018-05-29 00:44:37 +00:00
|
|
|
auto tracks = 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
|
|
|
|
AudioIOStartStreamOptions options { rate };
|
|
|
|
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
|
2017-09-07 03:35:54 +00:00
|
|
|
(GetTranslatedName(), _("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 {
|
2017-05-20 16:11:02 +00:00
|
|
|
ShowErrorDialog(FocusDialog, _("Error"),
|
|
|
|
_("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
|
|
|
}
|
|
|
|
|
2017-09-07 03:35:54 +00:00
|
|
|
int Effect::MessageBox
|
|
|
|
(const wxString& message, long style, const wxString &titleStr)
|
|
|
|
{
|
|
|
|
wxString title;
|
|
|
|
if (titleStr.empty())
|
|
|
|
title = GetTranslatedName();
|
|
|
|
else
|
|
|
|
title = wxString::Format(_("%s: %s"), GetTranslatedName(), titleStr);
|
2017-09-06 21:39:33 +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,
|
|
|
|
const wxString & title,
|
|
|
|
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()
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
|
|
|
|
long buttons = eOkButton;
|
2018-03-02 18:16:31 +00:00
|
|
|
if ((mType != EffectTypeAnalyze) && (mType != EffectTypeTool))
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2015-05-04 16:06:27 +00:00
|
|
|
buttons |= eCancelButton;
|
2015-04-17 03:53:42 +00:00
|
|
|
if (mType == EffectTypeProcess)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
buttons |= ePreviewButton;
|
|
|
|
}
|
|
|
|
}
|
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;
|
|
|
|
}
|
|
|
|
|
2014-11-16 06:52:36 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// EffectPanel
|
|
|
|
//
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-06-25 18:18:23 +00:00
|
|
|
class EffectPanel final : public wxPanelWrapper
|
2014-11-16 06:52:36 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
EffectPanel(wxWindow *parent)
|
2016-06-25 18:18:23 +00:00
|
|
|
: wxPanelWrapper(parent)
|
2014-11-16 06:52:36 +00:00
|
|
|
{
|
2015-04-20 04:03:54 +00:00
|
|
|
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
2015-04-20 17:33:03 +00:00
|
|
|
SetName(wxT("\a"));
|
|
|
|
SetLabel(wxT("\a"));
|
2015-04-20 04:03:54 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
mAcceptsFocus = true;
|
2014-11-16 06:52:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~EffectPanel()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// wxWindow implementation
|
|
|
|
// ============================================================================
|
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
bool AcceptsFocus() const override
|
2014-11-16 06:52:36 +00:00
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
return mAcceptsFocus;
|
|
|
|
}
|
|
|
|
|
2015-11-26 15:21:48 +00:00
|
|
|
// So that wxPanel is not included in Tab traversal, when required - see wxWidgets bug 15581
|
2016-02-24 06:06:47 +00:00
|
|
|
bool AcceptsFocusFromKeyboard() const override
|
2015-11-26 15:21:48 +00:00
|
|
|
{
|
|
|
|
return mAcceptsFocus;
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// ============================================================================
|
|
|
|
// EffectPanel implementation
|
|
|
|
// ============================================================================
|
|
|
|
void SetAccept(bool accept)
|
|
|
|
{
|
|
|
|
mAcceptsFocus = accept;
|
2014-11-16 06:52:36 +00:00
|
|
|
}
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool mAcceptsFocus;
|
2014-11-16 06:52:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// EffectUIHost
|
|
|
|
//
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
#include "../../images/Effect.h"
|
|
|
|
|
2016-07-10 21:10:50 +00:00
|
|
|
BEGIN_EVENT_TABLE(EffectUIHost, wxDialogWrapper)
|
2015-04-29 08:26:47 +00:00
|
|
|
EVT_INIT_DIALOG(EffectUIHost::OnInitDialog)
|
2015-04-17 03:53:42 +00:00
|
|
|
EVT_ERASE_BACKGROUND(EffectUIHost::OnErase)
|
|
|
|
EVT_PAINT(EffectUIHost::OnPaint)
|
2014-11-14 03:03:17 +00:00
|
|
|
EVT_CLOSE(EffectUIHost::OnClose)
|
2014-12-02 08:55:02 +00:00
|
|
|
EVT_BUTTON(wxID_APPLY, EffectUIHost::OnApply)
|
2014-11-14 03:03:17 +00:00
|
|
|
EVT_BUTTON(wxID_CANCEL, EffectUIHost::OnCancel)
|
2017-05-15 21:00:33 +00:00
|
|
|
EVT_BUTTON(wxID_HELP, EffectUIHost::OnHelp)
|
2015-04-22 20:55:58 +00:00
|
|
|
EVT_BUTTON(eDebugID, EffectUIHost::OnDebug)
|
2014-12-02 08:55:02 +00:00
|
|
|
EVT_BUTTON(kMenuID, EffectUIHost::OnMenu)
|
2014-12-20 18:22:44 +00:00
|
|
|
EVT_CHECKBOX(kEnableID, EffectUIHost::OnEnable)
|
2014-12-02 08:55:02 +00:00
|
|
|
EVT_BUTTON(kPlayID, EffectUIHost::OnPlay)
|
|
|
|
EVT_BUTTON(kRewindID, EffectUIHost::OnRewind)
|
|
|
|
EVT_BUTTON(kFFwdID, EffectUIHost::OnFFwd)
|
2014-11-14 03:03:17 +00:00
|
|
|
EVT_MENU(kSaveAsID, EffectUIHost::OnSaveAs)
|
|
|
|
EVT_MENU(kImportID, EffectUIHost::OnImport)
|
|
|
|
EVT_MENU(kExportID, EffectUIHost::OnExport)
|
|
|
|
EVT_MENU(kOptionsID, EffectUIHost::OnOptions)
|
|
|
|
EVT_MENU(kDefaultsID, EffectUIHost::OnDefaults)
|
|
|
|
EVT_MENU_RANGE(kUserPresetsID, kUserPresetsID + 999, EffectUIHost::OnUserPreset)
|
|
|
|
EVT_MENU_RANGE(kDeletePresetID, kDeletePresetID + 999, EffectUIHost::OnDeletePreset)
|
|
|
|
EVT_MENU_RANGE(kFactoryPresetsID, kFactoryPresetsID + 999, EffectUIHost::OnFactoryPreset)
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
EffectUIHost::EffectUIHost(wxWindow *parent,
|
2014-11-27 12:22:41 +00:00
|
|
|
Effect *effect,
|
2014-11-14 03:03:17 +00:00
|
|
|
EffectUIClientInterface *client)
|
2017-09-07 03:35:54 +00:00
|
|
|
: wxDialogWrapper(parent, wxID_ANY, effect->GetTranslatedName(),
|
2015-04-17 03:53:42 +00:00
|
|
|
wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2015-07-12 00:33:04 +00:00
|
|
|
#if defined(__WXMAC__)
|
|
|
|
// Make sure the effect window actually floats above the main window
|
2018-08-15 10:29:12 +00:00
|
|
|
[ [((NSView *)GetHandle()) window] setLevel:NSFloatingWindowLevel];
|
2015-07-12 00:33:04 +00:00
|
|
|
#endif
|
|
|
|
|
2017-09-07 03:35:54 +00:00
|
|
|
SetName( effect->GetTranslatedName() );
|
2018-03-26 20:14:26 +00:00
|
|
|
SetExtraStyle(GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
|
2014-11-14 03:03:17 +00:00
|
|
|
|
|
|
|
mParent = parent;
|
2014-11-27 12:22:41 +00:00
|
|
|
mEffect = effect;
|
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
|
|
|
mCommand = NULL;
|
2014-11-14 03:03:17 +00:00
|
|
|
mClient = client;
|
2014-11-27 12:22:41 +00:00
|
|
|
|
2014-12-19 16:38:56 +00:00
|
|
|
mProject = GetActiveProject();
|
|
|
|
|
2014-11-27 12:22:41 +00:00
|
|
|
mInitialized = false;
|
2015-04-17 03:53:42 +00:00
|
|
|
mSupportsRealtime = false;
|
2014-11-27 12:22:41 +00:00
|
|
|
|
2014-12-19 16:38:56 +00:00
|
|
|
mDisableTransport = false;
|
|
|
|
|
2014-12-20 18:22:44 +00:00
|
|
|
mEnabled = true;
|
2014-12-19 16:38:56 +00:00
|
|
|
|
2014-12-16 05:49:51 +00:00
|
|
|
mPlayPos = 0.0;
|
2015-04-17 03:53:42 +00:00
|
|
|
mClient->SetHostUI(this);
|
2014-11-14 03:03:17 +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
|
|
|
EffectUIHost::EffectUIHost(wxWindow *parent,
|
|
|
|
AudacityCommand *command,
|
|
|
|
EffectUIClientInterface *client)
|
2018-03-08 18:31:42 +00:00
|
|
|
: wxDialogWrapper(parent, wxID_ANY, _("Some Command") /*command->GetTranslatedName()*/,
|
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
|
|
|
wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
|
|
|
|
{
|
|
|
|
#if defined(__WXMAC__)
|
|
|
|
// Make sure the effect window actually floats above the main window
|
2018-08-15 10:29:12 +00:00
|
|
|
[ [((NSView *)GetHandle()) window] setLevel:NSFloatingWindowLevel];
|
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
|
|
|
#endif
|
|
|
|
|
|
|
|
//SetName( command->GetTranslatedName() );
|
|
|
|
SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
|
|
|
|
|
|
|
|
mParent = parent;
|
|
|
|
mEffect = NULL;
|
|
|
|
mCommand = command;
|
|
|
|
mClient = client;
|
|
|
|
|
|
|
|
mProject = GetActiveProject();
|
|
|
|
|
|
|
|
mInitialized = false;
|
|
|
|
mSupportsRealtime = false;
|
|
|
|
|
|
|
|
mDisableTransport = false;
|
|
|
|
|
|
|
|
mEnabled = true;
|
|
|
|
|
|
|
|
mPlayPos = 0.0;
|
|
|
|
mClient->SetHostUI(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
EffectUIHost::~EffectUIHost()
|
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
CleanupRealtime();
|
|
|
|
|
|
|
|
if (mClient)
|
2014-11-27 12:22:41 +00:00
|
|
|
{
|
2017-07-24 22:45:42 +00:00
|
|
|
if (mNeedsResume)
|
|
|
|
Resume();
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
mClient->CloseUI();
|
|
|
|
mClient = NULL;
|
|
|
|
}
|
|
|
|
}
|
2015-01-06 18:01:04 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// ============================================================================
|
|
|
|
// wxWindow implementation
|
|
|
|
// ============================================================================
|
2015-01-06 18:01:04 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
bool EffectUIHost::TransferDataToWindow()
|
|
|
|
{
|
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
|
|
|
if( mEffect )
|
|
|
|
return mEffect->TransferDataToWindow();
|
|
|
|
if( mCommand )
|
|
|
|
return mCommand->TransferDataToWindow();
|
|
|
|
return false;
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectUIHost::TransferDataFromWindow()
|
|
|
|
{
|
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
|
|
|
if( mEffect)
|
|
|
|
return mEffect->TransferDataFromWindow();
|
|
|
|
if( mCommand)
|
|
|
|
return mCommand->TransferDataFromWindow();
|
|
|
|
return false;
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// wxDialog implementation
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
int EffectUIHost::ShowModal()
|
|
|
|
{
|
2015-05-04 16:06:27 +00:00
|
|
|
#if defined(__WXMSW__)
|
|
|
|
// Swap the Close and Apply buttons
|
|
|
|
wxSizer *sz = mApplyBtn->GetContainingSizer();
|
2016-02-13 23:06:49 +00:00
|
|
|
wxASSERT(mApplyBtn->GetParent()); // To justify safenew
|
|
|
|
wxButton *apply = safenew wxButton(mApplyBtn->GetParent(), wxID_APPLY);
|
2015-05-04 16:06:27 +00:00
|
|
|
sz->Replace(mCloseBtn, apply);
|
|
|
|
sz->Replace(mApplyBtn, mCloseBtn);
|
2015-05-17 16:10:16 +00:00
|
|
|
sz->Layout();
|
2016-08-10 05:40:31 +00:00
|
|
|
mApplyBtn->Destroy();
|
2015-05-04 16:06:27 +00:00
|
|
|
mApplyBtn = apply;
|
|
|
|
mApplyBtn->SetDefault();
|
|
|
|
mApplyBtn->SetLabel(wxGetStockLabel(wxID_OK, 0));
|
|
|
|
mCloseBtn->SetLabel(wxGetStockLabel(wxID_CANCEL, 0));
|
|
|
|
#else
|
2015-04-27 18:16:08 +00:00
|
|
|
mApplyBtn->SetLabel(wxGetStockLabel(wxID_OK));
|
2015-05-04 16:06:27 +00:00
|
|
|
mCloseBtn->SetLabel(wxGetStockLabel(wxID_CANCEL));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
Layout();
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2016-07-10 21:10:50 +00:00
|
|
|
return wxDialogWrapper::ShowModal();
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2014-11-16 06:52:36 +00:00
|
|
|
// ============================================================================
|
|
|
|
// EffectUIHost implementation
|
|
|
|
// ============================================================================
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
bool EffectUIHost::Initialize()
|
|
|
|
{
|
2016-02-14 07:54:25 +00:00
|
|
|
EffectPanel *w = safenew EffectPanel(this);
|
2018-08-10 14:35:06 +00:00
|
|
|
RTL_WORKAROUND(w);
|
2016-02-18 19:53:43 +00:00
|
|
|
{
|
|
|
|
auto vs = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
|
|
|
{
|
|
|
|
auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
// Try to give the window a sensible default/minimum size
|
|
|
|
w->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
|
|
|
|
mParent->GetSize().GetHeight() / 2));
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
mDisableTransport = !gAudioIO->IsAvailable(mProject);
|
|
|
|
mPlaying = gAudioIO->IsStreamActive(); // not exactly right, but will suffice
|
|
|
|
mCapturing = gAudioIO->IsStreamActive() && gAudioIO->GetNumCaptureChannels() > 0;
|
2014-12-02 08:55:02 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
if (!mClient->PopulateUI(w))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
hs->Add(w, 1, wxEXPAND);
|
|
|
|
vs->Add(hs.release(), 1, wxEXPAND);
|
|
|
|
}
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2016-06-25 18:18:23 +00:00
|
|
|
wxPanel *buttonPanel = safenew wxPanelWrapper(this, wxID_ANY);
|
|
|
|
wxPanel *const bar = safenew wxPanelWrapper(buttonPanel, wxID_ANY);
|
2014-12-16 21:41:58 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
|
|
|
bar->SetName(wxT("\a"));
|
|
|
|
bar->SetLabel(wxT("\a"));
|
2015-04-20 15:05:53 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
{
|
|
|
|
auto bs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
2015-04-17 03:53:42 +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
|
|
|
mSupportsRealtime = mEffect && mEffect->SupportsRealtime();
|
2016-02-18 19:53:43 +00:00
|
|
|
mIsGUI = mClient->IsGraphicalUI();
|
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
|
|
|
mIsBatch = (mEffect && mEffect->IsBatchProcessing()) ||
|
|
|
|
(mCommand && mCommand->IsBatchProcessing());
|
2014-12-16 21:41:58 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
wxBitmapButton *bb;
|
2014-12-16 21:41:58 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
int margin = 0;
|
2014-12-16 22:35:29 +00:00
|
|
|
|
|
|
|
#if defined(__WXMAC__)
|
2016-02-18 19:53:43 +00:00
|
|
|
margin = 3; // I'm sure it's needed because of the order things are created...
|
2014-12-16 22:35:29 +00:00
|
|
|
#endif
|
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
if (!mIsGUI)
|
2016-02-18 19:50:52 +00:00
|
|
|
{
|
|
|
|
wxASSERT(bar); // To justify safenew
|
2016-02-18 19:53:43 +00:00
|
|
|
mMenuBtn = safenew wxButton(bar, kMenuID, _("&Manage"));
|
|
|
|
bs->Add(mMenuBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
2016-02-18 19:50:52 +00:00
|
|
|
}
|
2016-02-18 19:53:43 +00:00
|
|
|
else
|
2016-02-18 19:50:52 +00:00
|
|
|
{
|
|
|
|
wxASSERT(bar); // To justify safenew
|
2018-08-10 17:38:38 +00:00
|
|
|
mMenuBtn = safenew wxBitmapButton(bar, kMenuID, CreateBitmap(effect_menu_xpm, true, true));
|
|
|
|
mMenuBtn->SetBitmapPressed(CreateBitmap(effect_menu_xpm, false, true));
|
2014-12-19 09:05:32 +00:00
|
|
|
#if defined(__WXMAC__)
|
2016-02-18 19:53:43 +00:00
|
|
|
mMenuBtn->SetName(_("&Manage"));
|
2014-12-19 09:05:32 +00:00
|
|
|
#else
|
2016-02-18 19:53:43 +00:00
|
|
|
mMenuBtn->SetLabel(_("&Manage"));
|
2014-12-19 09:05:32 +00:00
|
|
|
#endif
|
2016-02-18 19:53:43 +00:00
|
|
|
bs->Add(mMenuBtn);
|
2016-02-18 19:50:52 +00:00
|
|
|
}
|
2016-02-18 19:53:43 +00:00
|
|
|
mMenuBtn->SetToolTip(_("Manage presets and options"));
|
2014-12-16 21:41:58 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
bs->Add(5, 5);
|
|
|
|
|
|
|
|
if (!mIsBatch)
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
2016-02-18 19:53:43 +00:00
|
|
|
if (!mIsGUI)
|
|
|
|
{
|
|
|
|
if (mSupportsRealtime)
|
|
|
|
{
|
|
|
|
wxASSERT(bar); // To justify safenew
|
|
|
|
mPlayToggleBtn = safenew wxButton(bar, kPlayID, _("Start &Playback"));
|
|
|
|
mPlayToggleBtn->SetToolTip(_("Start and stop playback"));
|
|
|
|
bs->Add(mPlayToggleBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
|
|
|
}
|
2018-03-02 18:16:31 +00:00
|
|
|
else if (mEffect &&
|
|
|
|
(mEffect->GetType() != EffectTypeAnalyze) &&
|
|
|
|
(mEffect->GetType() != EffectTypeTool)
|
|
|
|
)
|
2016-02-18 19:53:43 +00:00
|
|
|
{
|
|
|
|
wxASSERT(bar); // To justify safenew
|
|
|
|
mPlayToggleBtn = safenew wxButton(bar, kPlayID, _("&Preview"));
|
|
|
|
mPlayToggleBtn->SetToolTip(_("Preview effect"));
|
|
|
|
bs->Add(mPlayToggleBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mPlayBM = CreateBitmap(effect_play_xpm, true, false);
|
2018-08-10 17:38:38 +00:00
|
|
|
mPlayDisabledBM = CreateBitmap(effect_play_disabled_xpm, true, true);
|
2016-02-18 19:53:43 +00:00
|
|
|
mStopBM = CreateBitmap(effect_stop_xpm, true, false);
|
|
|
|
mStopDisabledBM = CreateBitmap(effect_stop_disabled_xpm, true, false);
|
|
|
|
wxASSERT(bar); // To justify safenew
|
|
|
|
bb = safenew wxBitmapButton(bar, kPlayID, mPlayBM);
|
|
|
|
bb->SetBitmapDisabled(mPlayDisabledBM);
|
2018-08-10 17:38:38 +00:00
|
|
|
bb->SetBitmapPressed(CreateBitmap(effect_play_xpm, false, true));
|
2016-02-18 19:53:43 +00:00
|
|
|
mPlayBtn = bb;
|
|
|
|
bs->Add(mPlayBtn);
|
|
|
|
if (!mSupportsRealtime)
|
|
|
|
{
|
|
|
|
mPlayBtn->SetToolTip(_("Preview effect"));
|
2014-12-19 09:05:32 +00:00
|
|
|
#if defined(__WXMAC__)
|
2016-02-18 19:53:43 +00:00
|
|
|
mPlayBtn->SetName(_("Preview effect"));
|
2014-12-19 09:05:32 +00:00
|
|
|
#else
|
2016-02-18 19:53:43 +00:00
|
|
|
mPlayBtn->SetLabel(_("&Preview effect"));
|
2014-12-19 09:05:32 +00:00
|
|
|
#endif
|
2016-02-18 19:53:43 +00:00
|
|
|
}
|
|
|
|
}
|
2014-12-16 21:41:58 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
if (mSupportsRealtime)
|
|
|
|
{
|
|
|
|
if (!mIsGUI)
|
|
|
|
{
|
|
|
|
wxASSERT(bar); // To justify safenew
|
|
|
|
mRewindBtn = safenew wxButton(bar, kRewindID, _("Skip &Backward"));
|
|
|
|
bs->Add(mRewindBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wxASSERT(bar); // To justify safenew
|
|
|
|
bb = safenew wxBitmapButton(bar, kRewindID, CreateBitmap(effect_rewind_xpm, true, true));
|
2018-08-10 17:38:38 +00:00
|
|
|
bb->SetBitmapDisabled(CreateBitmap(effect_rewind_disabled_xpm, true, false));
|
|
|
|
bb->SetBitmapPressed(CreateBitmap(effect_rewind_xpm, false, true));
|
2016-02-18 19:53:43 +00:00
|
|
|
mRewindBtn = bb;
|
|
|
|
#if defined(__WXMAC__)
|
|
|
|
mRewindBtn->SetName(_("Skip &Backward"));
|
|
|
|
#else
|
|
|
|
mRewindBtn->SetLabel(_("Skip &Backward"));
|
|
|
|
#endif
|
|
|
|
bs->Add(mRewindBtn);
|
|
|
|
}
|
|
|
|
mRewindBtn->SetToolTip(_("Skip backward"));
|
|
|
|
|
|
|
|
if (!mIsGUI)
|
|
|
|
{
|
|
|
|
wxASSERT(bar); // To justify safenew
|
|
|
|
mFFwdBtn = safenew wxButton(bar, kFFwdID, _("Skip &Forward"));
|
|
|
|
bs->Add(mFFwdBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wxASSERT(bar); // To justify safenew
|
|
|
|
bb = safenew wxBitmapButton(bar, kFFwdID, CreateBitmap(effect_ffwd_xpm, true, true));
|
2018-08-10 17:38:38 +00:00
|
|
|
bb->SetBitmapDisabled(CreateBitmap(effect_ffwd_disabled_xpm, true, false));
|
|
|
|
bb->SetBitmapPressed(CreateBitmap(effect_ffwd_xpm, false, true));
|
2016-02-18 19:53:43 +00:00
|
|
|
mFFwdBtn = bb;
|
2016-02-18 07:54:50 +00:00
|
|
|
#if defined(__WXMAC__)
|
2017-11-27 01:33:49 +00:00
|
|
|
mFFwdBtn->SetName(_("Skip &Forward"));
|
2016-02-18 07:54:50 +00:00
|
|
|
#else
|
2017-11-27 01:33:49 +00:00
|
|
|
mFFwdBtn->SetLabel(_("Skip &Forward"));
|
2016-02-18 07:54:50 +00:00
|
|
|
#endif
|
2016-02-18 19:53:43 +00:00
|
|
|
bs->Add(mFFwdBtn);
|
|
|
|
}
|
|
|
|
mFFwdBtn->SetToolTip(_("Skip forward"));
|
|
|
|
|
|
|
|
bs->Add(5, 5);
|
|
|
|
|
|
|
|
mEnableCb = safenew wxCheckBox(bar, kEnableID, _("&Enable"));
|
|
|
|
mEnableCb->SetValue(mEnabled);
|
|
|
|
mEnableCb->SetName(_("Enable"));
|
|
|
|
bs->Add(mEnableCb, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
|
|
|
}
|
2015-04-26 21:41:05 +00:00
|
|
|
}
|
2014-12-20 18:22:44 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
bar->SetSizerAndFit(bs.release());
|
|
|
|
}
|
2014-12-20 18:22:44 +00:00
|
|
|
|
2017-05-15 21:00:33 +00:00
|
|
|
long buttons;
|
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
|
|
|
if ( mEffect && mEffect->ManualPage().IsEmpty() && mEffect->HelpPage().IsEmpty()) {
|
2017-05-19 17:20:05 +00:00
|
|
|
buttons = eApplyButton + eCloseButton;
|
|
|
|
this->SetAcceleratorTable(wxNullAcceleratorTable);
|
|
|
|
}
|
|
|
|
else {
|
2017-05-15 21:00:33 +00:00
|
|
|
buttons = eApplyButton + eCloseButton + eHelpButton;
|
|
|
|
wxAcceleratorEntry entries[1];
|
|
|
|
#if defined(__WXMAC__)
|
2017-05-19 19:43:55 +00:00
|
|
|
// Is there a standard shortcut on Mac?
|
2017-05-15 21:00:33 +00:00
|
|
|
#else
|
|
|
|
entries[0].Set(wxACCEL_NORMAL, (int) WXK_F1, wxID_HELP);
|
|
|
|
#endif
|
|
|
|
wxAcceleratorTable accel(1, entries);
|
|
|
|
this->SetAcceleratorTable(accel);
|
|
|
|
}
|
2014-12-16 21:41:58 +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
|
|
|
if (mEffect && mEffect->mUIDebug) {
|
2017-05-21 22:11:21 +00:00
|
|
|
buttons += eDebugButton;
|
|
|
|
}
|
2017-05-15 21:00:33 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
buttonPanel->SetSizer(CreateStdButtonSizer(buttonPanel, buttons, bar).release());
|
|
|
|
vs->Add(buttonPanel, 0, wxEXPAND);
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2016-02-18 19:53:43 +00:00
|
|
|
SetSizer(vs.release());
|
2015-04-26 21:41:05 +00:00
|
|
|
}
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
Layout();
|
|
|
|
Fit();
|
|
|
|
Center();
|
|
|
|
|
2015-05-15 23:50:08 +00:00
|
|
|
mApplyBtn = (wxButton *) FindWindow(wxID_APPLY);
|
|
|
|
mCloseBtn = (wxButton *) FindWindow(wxID_CANCEL);
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
UpdateControls();
|
|
|
|
|
|
|
|
w->SetAccept(!mIsGUI);
|
2015-05-15 23:50:08 +00:00
|
|
|
(!mIsGUI ? w : FindWindow(wxID_APPLY))->SetFocus();
|
2014-11-25 08:08:15 +00:00
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
LoadUserPresets();
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
InitializeRealtime();
|
2014-11-27 12:22:41 +00:00
|
|
|
|
2015-06-30 16:25:32 +00:00
|
|
|
SetMinSize(GetSize());
|
2015-04-17 03:53:42 +00:00
|
|
|
return true;
|
|
|
|
}
|
2014-11-27 12:22:41 +00:00
|
|
|
|
2015-04-29 08:26:47 +00:00
|
|
|
void EffectUIHost::OnInitDialog(wxInitDialogEvent & evt)
|
|
|
|
{
|
|
|
|
// Do default handling
|
2016-07-10 21:10:50 +00:00
|
|
|
wxDialogWrapper::OnInitDialog(evt);
|
2015-04-29 08:26:47 +00:00
|
|
|
|
|
|
|
#if wxCHECK_VERSION(3, 0, 0)
|
2015-05-16 20:40:29 +00:00
|
|
|
//#warning "check to see if this still needed in wx3"
|
2015-04-29 08:26:47 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Pure hackage coming down the pike...
|
|
|
|
//
|
|
|
|
// I have no idea why, but if a wxTextCtrl is the first control in the
|
|
|
|
// panel, then its contents will not be automatically selected when the
|
|
|
|
// dialog is displayed.
|
|
|
|
//
|
|
|
|
// So, we do the selection manually.
|
|
|
|
wxTextCtrl *focused = wxDynamicCast(FindFocus(), wxTextCtrl);
|
|
|
|
if (focused)
|
|
|
|
{
|
|
|
|
focused->SelectAll();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
void EffectUIHost::OnErase(wxEraseEvent & WXUNUSED(evt))
|
|
|
|
{
|
|
|
|
// Ignore it
|
|
|
|
}
|
2014-12-02 08:55:02 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
void EffectUIHost::OnPaint(wxPaintEvent & WXUNUSED(evt))
|
|
|
|
{
|
|
|
|
wxPaintDC dc(this);
|
2014-12-02 08:55:02 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
dc.Clear();
|
2014-11-14 03:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void EffectUIHost::OnClose(wxCloseEvent & WXUNUSED(evt))
|
|
|
|
{
|
2016-04-23 12:49:11 +00:00
|
|
|
DoCancel();
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
CleanupRealtime();
|
2014-11-27 12:22:41 +00:00
|
|
|
|
2014-11-16 06:52:36 +00:00
|
|
|
Hide();
|
|
|
|
|
2017-07-24 22:45:42 +00:00
|
|
|
if (mNeedsResume)
|
|
|
|
Resume();
|
2014-11-14 03:03:17 +00:00
|
|
|
mClient->CloseUI();
|
|
|
|
mClient = NULL;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
Destroy();
|
|
|
|
}
|
|
|
|
|
2015-04-22 20:55:58 +00:00
|
|
|
void EffectUIHost::OnApply(wxCommandEvent & evt)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2015-04-17 03:53:42 +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_APPLY)->IsEnabled())
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-05-17 06:02:52 +00:00
|
|
|
// Honor the "select all if none" preference...a little hackish, but whatcha gonna do...
|
2018-08-01 19:03:53 +00:00
|
|
|
if (!mIsBatch &&
|
|
|
|
mEffect &&
|
|
|
|
mEffect->GetType() != EffectTypeGenerate &&
|
|
|
|
mEffect->GetType() != EffectTypeTool &&
|
|
|
|
mProject->mViewInfo.selectedRegion.isPoint())
|
2014-12-16 05:49:51 +00:00
|
|
|
{
|
2016-05-06 00:02:13 +00:00
|
|
|
auto flags = AlwaysEnabledFlag;
|
2017-08-20 04:16:22 +00:00
|
|
|
bool allowed =
|
|
|
|
GetMenuCommandHandler(*mProject).ReportIfActionNotAllowed(
|
|
|
|
*mProject,
|
2017-09-07 03:35:54 +00:00
|
|
|
mEffect->GetTranslatedName(),
|
2017-06-09 18:11:05 +00:00
|
|
|
flags,
|
|
|
|
WaveTracksSelectedFlag | TimeSelectedFlag,
|
|
|
|
WaveTracksSelectedFlag | TimeSelectedFlag);
|
2015-05-17 06:02:52 +00:00
|
|
|
if (!allowed)
|
|
|
|
return;
|
2014-12-16 05:49:51 +00:00
|
|
|
}
|
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
if (!mClient->ValidateUI())
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
// This will take care of calling TransferDataFromWindow() for an effect.
|
|
|
|
if (mEffect && !mEffect->SaveUserPreset(mEffect->GetCurrentSettingsGroup()))
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
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
|
|
|
// This will take care of calling TransferDataFromWindow() for a command.
|
|
|
|
if (mCommand ){
|
|
|
|
wxString params;
|
|
|
|
mCommand->GetAutomationParameters( params );
|
|
|
|
}
|
2014-11-27 12:22:41 +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
|
|
|
if( mEffect )
|
|
|
|
mEffect->mUIResultID = evt.GetId();
|
2015-04-22 20:55:58 +00:00
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
if (IsModal())
|
|
|
|
{
|
2016-04-24 14:30:46 +00:00
|
|
|
mDismissed = true;
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
EndModal(true);
|
2014-11-14 03:03:17 +00:00
|
|
|
|
|
|
|
Close();
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-05-04 17:15:54 +00:00
|
|
|
// Progress dialog no longer yields, so this "shouldn't" be necessary (yet to be proven
|
|
|
|
// for sure), but it is a nice visual cue that something is going on.
|
|
|
|
mApplyBtn->Disable();
|
2016-12-16 18:27:24 +00:00
|
|
|
auto cleanup = finally( [&] { mApplyBtn->Enable(); } );
|
2015-05-04 16:06:27 +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
|
|
|
if( mEffect )
|
|
|
|
mEffect->Apply();
|
|
|
|
if( mCommand )
|
|
|
|
mCommand->Apply();
|
2014-11-14 03:03:17 +00:00
|
|
|
}
|
|
|
|
|
2016-04-23 12:49:11 +00:00
|
|
|
void EffectUIHost::DoCancel()
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2016-04-24 14:30:46 +00:00
|
|
|
if (!mDismissed) {
|
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
|
|
|
if( mEffect )
|
|
|
|
mEffect->mUIResultID = wxID_CANCEL;
|
2015-04-22 20:55:58 +00:00
|
|
|
|
2016-04-23 12:49:11 +00:00
|
|
|
if (IsModal())
|
|
|
|
EndModal(false);
|
|
|
|
else
|
|
|
|
Hide();
|
2014-11-19 06:58:44 +00:00
|
|
|
|
2016-04-24 14:30:46 +00:00
|
|
|
mDismissed = true;
|
2014-11-14 03:03:17 +00:00
|
|
|
}
|
2016-04-23 12:49:11 +00:00
|
|
|
}
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2017-12-08 11:26:09 +00:00
|
|
|
void EffectUIHost::OnCancel(wxCommandEvent & WXUNUSED(evt))
|
2016-04-23 12:49:11 +00:00
|
|
|
{
|
|
|
|
DoCancel();
|
2014-11-14 03:03:17 +00:00
|
|
|
Close();
|
|
|
|
}
|
|
|
|
|
2017-05-15 21:00:33 +00:00
|
|
|
void EffectUIHost::OnHelp(wxCommandEvent & WXUNUSED(event))
|
|
|
|
{
|
2018-03-29 16:28:35 +00:00
|
|
|
if (mEffect && mEffect->GetFamilyId() == NYQUISTEFFECTS_FAMILY && (mEffect->ManualPage().IsEmpty())) {
|
2017-08-25 12:54:37 +00:00
|
|
|
// Old ShowHelp required when there is no on-line manual.
|
2017-05-19 17:20:05 +00:00
|
|
|
// Always use default web browser to allow full-featured HTML pages.
|
2017-08-25 12:54:37 +00:00
|
|
|
HelpSystem::ShowHelp(FindWindow(wxID_HELP), mEffect->HelpPage(), wxEmptyString, true, true);
|
2017-05-19 17:20:05 +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
|
|
|
else if( mEffect )
|
|
|
|
{
|
2017-08-25 12:54:37 +00:00
|
|
|
// otherwise use the NEW ShowHelp
|
|
|
|
HelpSystem::ShowHelp(FindWindow(wxID_HELP), mEffect->ManualPage(), true);
|
2017-05-19 17:20:05 +00:00
|
|
|
}
|
2017-05-15 21:00:33 +00:00
|
|
|
}
|
|
|
|
|
2015-04-22 20:55:58 +00:00
|
|
|
void EffectUIHost::OnDebug(wxCommandEvent & evt)
|
|
|
|
{
|
|
|
|
OnApply(evt);
|
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
|
|
|
if( mEffect )
|
|
|
|
mEffect->mUIResultID = evt.GetId();
|
2015-04-22 20:55:58 +00:00
|
|
|
}
|
|
|
|
|
2014-12-15 21:54:23 +00:00
|
|
|
void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt))
|
2014-12-02 08:55:02 +00:00
|
|
|
{
|
2016-02-01 01:39:24 +00:00
|
|
|
wxMenu menu;
|
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
|
|
|
if( !mEffect )
|
|
|
|
return;
|
2014-12-02 08:55:02 +00:00
|
|
|
|
|
|
|
LoadUserPresets();
|
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
if (mUserPresets.GetCount() == 0)
|
|
|
|
{
|
2016-02-01 01:39:24 +00:00
|
|
|
menu.Append(kUserPresetsDummyID, _("User Presets"))->Enable(false);
|
2014-12-04 06:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
2014-12-02 08:55:02 +00:00
|
|
|
{
|
2016-08-10 05:32:13 +00:00
|
|
|
auto sub = std::make_unique<wxMenu>();
|
2014-12-04 06:10:27 +00:00
|
|
|
for (size_t i = 0, cnt = mUserPresets.GetCount(); i < cnt; i++)
|
|
|
|
{
|
|
|
|
sub->Append(kUserPresetsID + i, mUserPresets[i]);
|
|
|
|
}
|
2016-08-10 05:32:13 +00:00
|
|
|
menu.Append(0, _("User Presets"), sub.release());
|
2014-12-02 08:55:02 +00:00
|
|
|
}
|
|
|
|
|
2016-02-01 01:39:24 +00:00
|
|
|
menu.Append(kSaveAsID, _("Save Preset..."));
|
2015-05-20 02:13:20 +00:00
|
|
|
|
|
|
|
if (mUserPresets.GetCount() == 0)
|
|
|
|
{
|
2016-02-01 01:39:24 +00:00
|
|
|
menu.Append(kDeletePresetDummyID, _("Delete Preset"))->Enable(false);
|
2015-05-20 02:13:20 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-08-10 05:32:13 +00:00
|
|
|
auto sub = std::make_unique<wxMenu>();
|
2015-05-20 02:13:20 +00:00
|
|
|
for (size_t i = 0, cnt = mUserPresets.GetCount(); i < cnt; i++)
|
|
|
|
{
|
|
|
|
sub->Append(kDeletePresetID + i, mUserPresets[i]);
|
|
|
|
}
|
2016-08-10 05:32:13 +00:00
|
|
|
menu.Append(0, _("Delete Preset"), sub.release());
|
2015-05-20 02:13:20 +00:00
|
|
|
}
|
|
|
|
|
2016-02-01 01:39:24 +00:00
|
|
|
menu.AppendSeparator();
|
2015-05-20 02:13:20 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
wxArrayString factory = mEffect->GetFactoryPresets();
|
2014-12-02 08:55:02 +00:00
|
|
|
|
|
|
|
{
|
2016-08-10 05:32:13 +00:00
|
|
|
auto sub = std::make_unique<wxMenu>();
|
|
|
|
sub->Append(kDefaultsID, _("Defaults"));
|
|
|
|
if (factory.GetCount() > 0)
|
2014-12-02 08:55:02 +00:00
|
|
|
{
|
2016-08-10 05:32:13 +00:00
|
|
|
sub->AppendSeparator();
|
|
|
|
for (size_t i = 0, cnt = factory.GetCount(); i < cnt; i++)
|
2014-12-02 08:55:02 +00:00
|
|
|
{
|
2016-08-10 05:32:13 +00:00
|
|
|
wxString label = factory[i];
|
|
|
|
if (label.IsEmpty())
|
|
|
|
{
|
|
|
|
label = _("None");
|
|
|
|
}
|
2014-12-02 08:55:02 +00:00
|
|
|
|
2016-08-10 05:32:13 +00:00
|
|
|
sub->Append(kFactoryPresetsID + i, label);
|
|
|
|
}
|
2014-12-02 08:55:02 +00:00
|
|
|
}
|
2016-08-10 05:32:13 +00:00
|
|
|
menu.Append(0, _("Factory Presets"), sub.release());
|
2014-12-02 08:55:02 +00:00
|
|
|
}
|
|
|
|
|
2016-02-01 01:39:24 +00:00
|
|
|
menu.AppendSeparator();
|
|
|
|
menu.Append(kImportID, _("Import..."))->Enable(mClient->CanExportPresets());
|
|
|
|
menu.Append(kExportID, _("Export..."))->Enable(mClient->CanExportPresets());
|
|
|
|
menu.AppendSeparator();
|
|
|
|
menu.Append(kOptionsID, _("Options..."))->Enable(mClient->HasOptions());
|
|
|
|
menu.AppendSeparator();
|
2014-12-02 08:55:02 +00:00
|
|
|
|
2016-08-10 05:32:13 +00:00
|
|
|
{
|
|
|
|
auto sub = std::make_unique<wxMenu>();
|
2014-12-02 08:55:02 +00:00
|
|
|
|
2018-01-16 04:40:42 +00:00
|
|
|
sub->Append(kDummyID, wxString::Format(_("Type: %s"),
|
2018-03-29 16:28:35 +00:00
|
|
|
::wxGetTranslation( mEffect->GetFamilyId().Translation() )));
|
2017-10-09 05:03:14 +00:00
|
|
|
sub->Append(kDummyID, wxString::Format(_("Name: %s"), mEffect->GetTranslatedName()));
|
|
|
|
sub->Append(kDummyID, wxString::Format(_("Version: %s"), mEffect->GetVersion()));
|
2018-03-29 18:56:52 +00:00
|
|
|
sub->Append(kDummyID, wxString::Format(_("Vendor: %s"), mEffect->GetVendor().Translation()));
|
2018-01-08 00:45:20 +00:00
|
|
|
sub->Append(kDummyID, wxString::Format(_("Description: %s"), mEffect->GetDescription()));
|
2014-12-02 08:55:02 +00:00
|
|
|
|
2016-08-10 05:32:13 +00:00
|
|
|
menu.Append(0, _("About"), sub.release());
|
|
|
|
}
|
2014-12-02 08:55:02 +00:00
|
|
|
|
2015-05-24 09:47:24 +00:00
|
|
|
wxWindow *btn = FindWindow(kMenuID);
|
|
|
|
wxRect r = btn->GetRect();
|
2016-02-01 01:39:24 +00:00
|
|
|
btn->PopupMenu(&menu, r.GetLeft(), r.GetBottom());
|
2014-12-02 08:55:02 +00:00
|
|
|
}
|
|
|
|
|
2017-07-24 22:45:42 +00:00
|
|
|
void EffectUIHost::Resume()
|
|
|
|
{
|
|
|
|
if (!mClient->ValidateUI()) {
|
|
|
|
// If we're previewing we should still be able to stop playback
|
|
|
|
// so don't disable transport buttons.
|
|
|
|
// mEffect->EnableApply(false); // currently this would also disable transport buttons.
|
|
|
|
// The preferred behaviour is currently undecided, so for now
|
|
|
|
// just disallow enabling until settings are valid.
|
|
|
|
mEnabled = false;
|
|
|
|
mEnableCb->SetValue(mEnabled);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
mEffect->RealtimeResume();
|
|
|
|
}
|
|
|
|
|
2014-12-19 06:57:22 +00:00
|
|
|
void EffectUIHost::OnEnable(wxCommandEvent & WXUNUSED(evt))
|
2014-12-02 08:55:02 +00:00
|
|
|
{
|
2014-12-20 18:22:44 +00:00
|
|
|
mEnabled = mEnableCb->GetValue();
|
2014-12-02 08:55:02 +00:00
|
|
|
|
2017-07-24 22:45:42 +00:00
|
|
|
if (mEnabled) {
|
|
|
|
Resume();
|
|
|
|
mNeedsResume = false;
|
2014-12-02 08:55:02 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-20 18:22:44 +00:00
|
|
|
mEffect->RealtimeSuspend();
|
2017-07-24 22:45:42 +00:00
|
|
|
mNeedsResume = true;
|
2014-12-02 08:55:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UpdateControls();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectUIHost::OnPlay(wxCommandEvent & WXUNUSED(evt))
|
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
if (!mSupportsRealtime)
|
|
|
|
{
|
|
|
|
if (!mClient->ValidateUI() || !mEffect->TransferDataFromWindow())
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
mEffect->Preview(false);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
if (mPlaying)
|
2014-12-02 08:55:02 +00:00
|
|
|
{
|
2014-12-04 06:10:27 +00:00
|
|
|
mPlayPos = gAudioIO->GetStreamTime();
|
2014-12-19 16:38:56 +00:00
|
|
|
mProject->GetControlToolBar()->StopPlaying();
|
2014-12-02 08:55:02 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-19 16:38:56 +00:00
|
|
|
if (mProject->IsPlayRegionLocked())
|
2014-12-16 05:49:51 +00:00
|
|
|
{
|
|
|
|
double t0, t1;
|
2014-12-19 16:38:56 +00:00
|
|
|
mProject->GetPlayRegion(&t0, &t1);
|
2014-12-16 05:49:51 +00:00
|
|
|
mRegion.setTimes(t0, t1);
|
|
|
|
mPlayPos = mRegion.t0();
|
|
|
|
}
|
2014-12-19 16:38:56 +00:00
|
|
|
else if (mProject->mViewInfo.selectedRegion.t0() != mRegion.t0() ||
|
|
|
|
mProject->mViewInfo.selectedRegion.t1() != mRegion.t1())
|
2014-12-04 06:10:27 +00:00
|
|
|
{
|
2014-12-19 16:38:56 +00:00
|
|
|
mRegion = mProject->mViewInfo.selectedRegion;
|
2014-12-04 06:10:27 +00:00
|
|
|
mPlayPos = mRegion.t0();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mPlayPos > mRegion.t1())
|
|
|
|
{
|
|
|
|
mPlayPos = mRegion.t1();
|
|
|
|
}
|
|
|
|
|
2015-04-14 18:52:22 +00:00
|
|
|
mProject->GetControlToolBar()->PlayPlayRegion
|
|
|
|
(SelectedRegion(mPlayPos, mRegion.t1()),
|
2016-04-18 21:50:17 +00:00
|
|
|
mProject->GetDefaultPlayOptions(), PlayMode::normalPlay);
|
2014-12-02 08:55:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectUIHost::OnRewind(wxCommandEvent & WXUNUSED(evt))
|
|
|
|
{
|
2014-12-04 06:10:27 +00:00
|
|
|
if (mPlaying)
|
|
|
|
{
|
|
|
|
double seek;
|
|
|
|
gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &seek, 1.0);
|
|
|
|
|
|
|
|
double pos = gAudioIO->GetStreamTime();
|
|
|
|
if (pos - seek < mRegion.t0())
|
|
|
|
{
|
|
|
|
seek = pos - mRegion.t0();
|
|
|
|
}
|
|
|
|
|
|
|
|
gAudioIO->SeekStream(-seek);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mPlayPos = mRegion.t0();
|
|
|
|
}
|
2014-12-02 08:55:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void EffectUIHost::OnFFwd(wxCommandEvent & WXUNUSED(evt))
|
|
|
|
{
|
2014-12-04 06:10:27 +00:00
|
|
|
if (mPlaying)
|
|
|
|
{
|
|
|
|
double seek;
|
|
|
|
gPrefs->Read(wxT("/AudioIO/SeekShortPeriod"), &seek, 1.0);
|
|
|
|
|
|
|
|
double pos = gAudioIO->GetStreamTime();
|
|
|
|
if (mRegion.t0() < mRegion.t1() && pos + seek > mRegion.t1())
|
|
|
|
{
|
|
|
|
seek = mRegion.t1() - pos;
|
|
|
|
}
|
|
|
|
|
|
|
|
gAudioIO->SeekStream(seek);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// It allows to play past end of selection...probably useless
|
|
|
|
mPlayPos = mRegion.t1();
|
|
|
|
}
|
2014-12-02 08:55:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void EffectUIHost::OnPlayback(wxCommandEvent & evt)
|
|
|
|
{
|
2014-12-17 19:16:08 +00:00
|
|
|
evt.Skip();
|
|
|
|
|
2014-12-19 16:38:56 +00:00
|
|
|
if (evt.GetInt() != 0)
|
|
|
|
{
|
|
|
|
if (evt.GetEventObject() != mProject)
|
|
|
|
{
|
|
|
|
mDisableTransport = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mPlaying = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mDisableTransport = false;
|
|
|
|
mPlaying = false;
|
|
|
|
}
|
2014-12-04 06:10:27 +00:00
|
|
|
|
|
|
|
if (mPlaying)
|
|
|
|
{
|
2014-12-19 16:38:56 +00:00
|
|
|
mRegion = mProject->mViewInfo.selectedRegion;
|
2014-12-04 06:10:27 +00:00
|
|
|
mPlayPos = mRegion.t0();
|
|
|
|
}
|
|
|
|
|
2014-12-02 08:55:02 +00:00
|
|
|
UpdateControls();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectUIHost::OnCapture(wxCommandEvent & evt)
|
|
|
|
{
|
2014-12-17 19:16:08 +00:00
|
|
|
evt.Skip();
|
|
|
|
|
2014-12-19 16:38:56 +00:00
|
|
|
if (evt.GetInt() != 0)
|
|
|
|
{
|
|
|
|
if (evt.GetEventObject() != mProject)
|
|
|
|
{
|
|
|
|
mDisableTransport = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mCapturing = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mDisableTransport = false;
|
|
|
|
mCapturing = false;
|
|
|
|
}
|
|
|
|
|
2014-12-02 08:55:02 +00:00
|
|
|
UpdateControls();
|
|
|
|
}
|
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
void EffectUIHost::OnUserPreset(wxCommandEvent & evt)
|
2014-12-02 08:55:02 +00:00
|
|
|
{
|
2014-12-04 06:10:27 +00:00
|
|
|
int preset = evt.GetId() - kUserPresetsID;
|
2014-12-02 08:55:02 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
mEffect->LoadUserPreset(mEffect->GetUserPresetsGroup(mUserPresets[preset]));
|
2014-12-02 08:55:02 +00:00
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
return;
|
2014-12-02 08:55:02 +00:00
|
|
|
}
|
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
void EffectUIHost::OnFactoryPreset(wxCommandEvent & evt)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
mEffect->LoadFactoryPreset(evt.GetId() - kFactoryPresetsID);
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
return;
|
|
|
|
}
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
void EffectUIHost::OnDeletePreset(wxCommandEvent & evt)
|
|
|
|
{
|
|
|
|
wxString preset = mUserPresets[evt.GetId() - kDeletePresetID];
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2017-10-09 05:03:14 +00:00
|
|
|
int res = AudacityMessageBox(wxString::Format(_("Are you sure you want to delete \"%s\"?"), preset),
|
2014-12-04 06:10:27 +00:00
|
|
|
_("Delete Preset"),
|
|
|
|
wxICON_QUESTION | wxYES_NO);
|
|
|
|
if (res == wxYES)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2014-12-04 06:10:27 +00:00
|
|
|
mEffect->RemovePrivateConfigSubgroup(mEffect->GetUserPresetsGroup(preset));
|
2014-11-14 03:03:17 +00:00
|
|
|
}
|
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
LoadUserPresets();
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
return;
|
2014-11-14 03:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void EffectUIHost::OnSaveAs(wxCommandEvent & WXUNUSED(evt))
|
|
|
|
{
|
|
|
|
wxTextCtrl *text;
|
|
|
|
wxString name;
|
2016-07-10 21:10:50 +00:00
|
|
|
wxDialogWrapper dlg(this, wxID_ANY, wxString(_("Save Preset")));
|
2014-11-29 01:22:41 +00:00
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
ShuttleGui S(&dlg, eIsCreating);
|
|
|
|
|
|
|
|
S.StartPanel();
|
|
|
|
{
|
2015-05-17 05:19:35 +00:00
|
|
|
S.StartVerticalLay(1);
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
|
|
|
S.StartHorizontalLay(wxALIGN_LEFT, 0);
|
|
|
|
{
|
|
|
|
text = S.AddTextBox(_("Preset name:"), name, 30);
|
|
|
|
}
|
|
|
|
S.EndHorizontalLay();
|
2015-05-17 05:19:35 +00:00
|
|
|
S.SetBorder(10);
|
2014-11-14 03:03:17 +00:00
|
|
|
S.AddStandardButtons();
|
|
|
|
}
|
|
|
|
S.EndVerticalLay();
|
|
|
|
}
|
|
|
|
S.EndPanel();
|
2015-05-17 05:19:35 +00:00
|
|
|
|
2014-11-14 03:03:17 +00:00
|
|
|
dlg.SetSize(dlg.GetSizer()->GetMinSize());
|
|
|
|
dlg.Center();
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
int rc = dlg.ShowModal();
|
|
|
|
|
|
|
|
if (rc != wxID_OK)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
name = text->GetValue();
|
2015-05-17 05:19:35 +00:00
|
|
|
if (name.IsEmpty())
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2017-10-12 16:21:52 +00:00
|
|
|
AudacityMessageDialog md(this,
|
2015-05-17 05:19:35 +00:00
|
|
|
_("You must specify a name"),
|
|
|
|
_("Save Preset"));
|
|
|
|
md.Center();
|
|
|
|
md.ShowModal();
|
|
|
|
continue;
|
2014-11-14 03:03:17 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 05:19:35 +00:00
|
|
|
if (mUserPresets.Index(name) != wxNOT_FOUND)
|
|
|
|
{
|
2017-10-12 16:21:52 +00:00
|
|
|
AudacityMessageDialog md(this,
|
2015-05-17 05:19:35 +00:00
|
|
|
_("Preset already exists.\n\nReplace?"),
|
|
|
|
_("Save Preset"),
|
|
|
|
wxYES_NO | wxCANCEL | wxICON_EXCLAMATION);
|
|
|
|
md.Center();
|
|
|
|
int choice = md.ShowModal();
|
|
|
|
if (choice == wxID_CANCEL)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (choice == wxID_NO)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mEffect->SaveUserPreset(mEffect->GetUserPresetsGroup(name));
|
|
|
|
LoadUserPresets();
|
|
|
|
|
|
|
|
break;
|
2014-11-14 03:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectUIHost::OnImport(wxCommandEvent & WXUNUSED(evt))
|
|
|
|
{
|
|
|
|
mClient->ImportPresets();
|
|
|
|
|
|
|
|
LoadUserPresets();
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectUIHost::OnExport(wxCommandEvent & WXUNUSED(evt))
|
|
|
|
{
|
2016-12-01 22:03:40 +00:00
|
|
|
// may throw
|
2016-12-02 01:40:05 +00:00
|
|
|
// exceptions are handled in AudacityApp::OnExceptionInMainLoop
|
2014-11-14 03:03:17 +00:00
|
|
|
mClient->ExportPresets();
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
void EffectUIHost::OnOptions(wxCommandEvent & WXUNUSED(evt))
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2014-12-04 06:10:27 +00:00
|
|
|
mClient->ShowOptions();
|
2014-11-14 03:03:17 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
void EffectUIHost::OnDefaults(wxCommandEvent & WXUNUSED(evt))
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
mEffect->LoadFactoryDefaults();
|
2014-11-14 03:03:17 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-01-14 11:32:03 +00:00
|
|
|
wxBitmap EffectUIHost::CreateBitmap(const char * const xpm[], bool up, bool pusher)
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2014-12-04 06:10:27 +00:00
|
|
|
wxMemoryDC dc;
|
|
|
|
wxBitmap pic(xpm);
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2018-08-10 17:38:38 +00:00
|
|
|
wxBitmap mod(pic.GetWidth() + 6, pic.GetHeight() + 6, 24);
|
2014-12-04 06:10:27 +00:00
|
|
|
dc.SelectObject(mod);
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
#if defined(__WXGTK__)
|
|
|
|
wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND);
|
2018-08-10 17:38:38 +00:00
|
|
|
#else
|
2014-12-04 06:10:27 +00:00
|
|
|
wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);
|
|
|
|
#endif
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
dc.SetBackground(wxBrush(newColour));
|
|
|
|
dc.Clear();
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
int offset = 3;
|
|
|
|
if (pusher)
|
|
|
|
{
|
|
|
|
if (!up)
|
|
|
|
{
|
|
|
|
offset += 1;
|
|
|
|
}
|
|
|
|
}
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
dc.DrawBitmap(pic, offset, offset, true);
|
2014-11-14 03:03:17 +00:00
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
dc.SelectObject(wxNullBitmap);
|
|
|
|
|
|
|
|
return mod;
|
2014-11-14 03:03:17 +00:00
|
|
|
}
|
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
void EffectUIHost::UpdateControls()
|
2014-11-14 03:03:17 +00:00
|
|
|
{
|
2015-04-26 21:41:05 +00:00
|
|
|
if (mIsBatch)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-12-19 16:38:56 +00:00
|
|
|
if (mCapturing || mDisableTransport)
|
|
|
|
{
|
|
|
|
// Don't allow focus to get trapped
|
|
|
|
wxWindow *focus = FindFocus();
|
2014-12-20 18:22:44 +00:00
|
|
|
if (focus == mRewindBtn || focus == mFFwdBtn || focus == mPlayBtn || focus == mEnableCb)
|
2014-12-19 16:38:56 +00:00
|
|
|
{
|
|
|
|
mCloseBtn->SetFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-04 06:10:27 +00:00
|
|
|
mApplyBtn->Enable(!mCapturing);
|
2018-03-02 18:16:31 +00:00
|
|
|
if (mEffect && (mEffect->GetType() != EffectTypeAnalyze) && (mEffect->GetType() != EffectTypeTool) )
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
(!mIsGUI ? mPlayToggleBtn : mPlayBtn)->Enable(!(mCapturing || mDisableTransport));
|
|
|
|
}
|
2014-12-16 21:41:58 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
if (mSupportsRealtime)
|
2014-12-15 09:18:42 +00:00
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
mRewindBtn->Enable(!(mCapturing || mDisableTransport));
|
|
|
|
mFFwdBtn->Enable(!(mCapturing || mDisableTransport));
|
|
|
|
mEnableCb->Enable(!(mCapturing || mDisableTransport));
|
|
|
|
|
|
|
|
wxBitmapButton *bb;
|
|
|
|
|
|
|
|
if (mPlaying)
|
2014-12-16 21:41:58 +00:00
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
if (!mIsGUI)
|
|
|
|
{
|
|
|
|
/* i18n-hint: The access key "&P" should be the same in
|
|
|
|
"Stop &Playback" and "Start &Playback" */
|
|
|
|
mPlayToggleBtn->SetLabel(_("Stop &Playback"));
|
|
|
|
mPlayToggleBtn->Refresh();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bb = (wxBitmapButton *) mPlayBtn;
|
|
|
|
bb->SetBitmapLabel(mStopBM);
|
|
|
|
bb->SetBitmapDisabled(mStopDisabledBM);
|
|
|
|
bb->SetToolTip(_("Stop"));
|
2014-12-19 06:57:22 +00:00
|
|
|
#if defined(__WXMAC__)
|
2015-04-17 03:53:42 +00:00
|
|
|
bb->SetName(_("Stop &Playback"));
|
2014-12-19 06:57:22 +00:00
|
|
|
#else
|
2015-04-17 03:53:42 +00:00
|
|
|
bb->SetLabel(_("Stop &Playback"));
|
2014-12-19 06:57:22 +00:00
|
|
|
#endif
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
2014-12-16 21:41:58 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-04-17 03:53:42 +00:00
|
|
|
if (!mIsGUI)
|
|
|
|
{
|
|
|
|
/* i18n-hint: The access key "&P" should be the same in
|
|
|
|
"Stop &Playback" and "Start &Playback" */
|
|
|
|
mPlayToggleBtn->SetLabel(_("Start &Playback"));
|
|
|
|
mPlayToggleBtn->Refresh();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bb = (wxBitmapButton *) mPlayBtn;
|
|
|
|
bb->SetBitmapLabel(mPlayBM);
|
|
|
|
bb->SetBitmapDisabled(mPlayDisabledBM);
|
|
|
|
bb->SetToolTip(_("Play"));
|
2014-12-19 06:57:22 +00:00
|
|
|
#if defined(__WXMAC__)
|
2015-04-17 03:53:42 +00:00
|
|
|
bb->SetName(_("Start &Playback"));
|
2014-12-19 06:57:22 +00:00
|
|
|
#else
|
2015-04-17 03:53:42 +00:00
|
|
|
bb->SetLabel(_("Start &Playback"));
|
2014-12-19 06:57:22 +00:00
|
|
|
#endif
|
2015-04-17 03:53:42 +00:00
|
|
|
}
|
2014-12-16 21:41:58 +00:00
|
|
|
}
|
2014-12-14 16:28:19 +00:00
|
|
|
}
|
2014-11-14 03:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void EffectUIHost::LoadUserPresets()
|
|
|
|
{
|
|
|
|
mUserPresets.Clear();
|
|
|
|
|
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
|
|
|
if( mEffect )
|
|
|
|
mEffect->GetPrivateConfigSubgroups(mEffect->GetUserPresetsGroup(wxEmptyString), mUserPresets);
|
2014-11-14 03:03:17 +00:00
|
|
|
|
|
|
|
mUserPresets.Sort();
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
void EffectUIHost::InitializeRealtime()
|
|
|
|
{
|
|
|
|
if (mSupportsRealtime && !mInitialized)
|
|
|
|
{
|
|
|
|
EffectManager::Get().RealtimeAddEffect(mEffect);
|
|
|
|
|
2018-02-12 23:09:20 +00:00
|
|
|
wxTheApp->Bind(EVT_AUDIOIO_PLAYBACK,
|
|
|
|
&EffectUIHost::OnPlayback,
|
2015-04-17 03:53:42 +00:00
|
|
|
this);
|
|
|
|
|
2018-02-12 23:09:20 +00:00
|
|
|
wxTheApp->Bind(EVT_AUDIOIO_CAPTURE,
|
|
|
|
&EffectUIHost::OnCapture,
|
2015-04-17 03:53:42 +00:00
|
|
|
this);
|
|
|
|
|
|
|
|
mInitialized = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectUIHost::CleanupRealtime()
|
|
|
|
{
|
|
|
|
if (mSupportsRealtime && mInitialized)
|
|
|
|
{
|
|
|
|
EffectManager::Get().RealtimeRemoveEffect(mEffect);
|
|
|
|
|
|
|
|
mInitialized = false;
|
|
|
|
}
|
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)
|
2016-07-10 21:10:50 +00:00
|
|
|
: wxDialogWrapper(parent, wxID_ANY, wxString(_("Select Preset")))
|
2015-04-26 21:41:05 +00:00
|
|
|
{
|
|
|
|
ShuttleGui S(this, eIsCreating);
|
|
|
|
S.StartVerticalLay();
|
|
|
|
{
|
|
|
|
S.StartTwoColumn();
|
|
|
|
S.SetStretchyCol(1);
|
|
|
|
{
|
|
|
|
wxArrayString empty;
|
|
|
|
|
|
|
|
S.AddPrompt(_("Type:"));
|
2017-09-28 01:20:14 +00:00
|
|
|
mType = S.Id(ID_Type).AddChoice( {}, wxT(""), &empty);
|
2015-04-26 21:41:05 +00:00
|
|
|
mType->SetSelection(0);
|
|
|
|
|
|
|
|
S.AddPrompt(_("&Preset:"));
|
|
|
|
mPresets = S.AddListBox(&empty, wxLB_SINGLE | wxLB_NEEDED_SB );
|
|
|
|
}
|
|
|
|
S.EndTwoColumn();
|
|
|
|
|
|
|
|
S.AddStandardButtons();
|
|
|
|
}
|
|
|
|
S.EndVerticalLay();
|
|
|
|
|
|
|
|
mUserPresets = effect->GetUserPresets();
|
|
|
|
mFactoryPresets = effect->GetFactoryPresets();
|
|
|
|
|
|
|
|
if (mUserPresets.GetCount() > 0)
|
|
|
|
{
|
|
|
|
mType->Append(_("User Presets"));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mFactoryPresets.GetCount() > 0)
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
SetPrefix(_("User Presets"), preset);
|
|
|
|
}
|
|
|
|
else if (preset.StartsWith(Effect::kFactoryPresetIdent))
|
|
|
|
{
|
|
|
|
preset.Replace(Effect::kFactoryPresetIdent, wxEmptyString, false);
|
|
|
|
SetPrefix(_("Factory Presets"), preset);
|
|
|
|
}
|
|
|
|
else if (preset.StartsWith(Effect::kCurrentSettingsIdent))
|
|
|
|
{
|
|
|
|
SetPrefix(_("Current Settings"), wxEmptyString);
|
|
|
|
}
|
|
|
|
else if (preset.StartsWith(Effect::kFactoryDefaultsIdent))
|
|
|
|
{
|
|
|
|
SetPrefix(_("Factory Defaults"), wxEmptyString);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectPresetsDialog::SetPrefix(const wxString & type, const wxString & prefix)
|
|
|
|
{
|
|
|
|
mType->SetStringSelection(type);
|
|
|
|
|
|
|
|
if (type.IsSameAs(_("User Presets")))
|
|
|
|
{
|
|
|
|
mPresets->Clear();
|
|
|
|
mPresets->Append(mUserPresets);
|
|
|
|
mPresets->Enable(true);
|
|
|
|
mPresets->SetStringSelection(prefix);
|
|
|
|
if (mPresets->GetSelection() == wxNOT_FOUND)
|
|
|
|
{
|
|
|
|
mPresets->SetSelection(0);
|
|
|
|
}
|
|
|
|
mSelection = Effect::kUserPresetIdent + mPresets->GetStringSelection();
|
|
|
|
}
|
|
|
|
else if (type.IsSameAs(_("Factory Presets")))
|
|
|
|
{
|
|
|
|
mPresets->Clear();
|
|
|
|
for (size_t i = 0, cnt = mFactoryPresets.GetCount(); i < cnt; i++)
|
|
|
|
{
|
|
|
|
wxString label = mFactoryPresets[i];
|
|
|
|
if (label.IsEmpty())
|
|
|
|
{
|
|
|
|
label = _("None");
|
|
|
|
}
|
|
|
|
mPresets->Append(label);
|
|
|
|
}
|
|
|
|
mPresets->Enable(true);
|
|
|
|
mPresets->SetStringSelection(prefix);
|
|
|
|
if (mPresets->GetSelection() == wxNOT_FOUND)
|
|
|
|
{
|
|
|
|
mPresets->SetSelection(0);
|
|
|
|
}
|
|
|
|
mSelection = Effect::kFactoryPresetIdent + mPresets->GetStringSelection();
|
|
|
|
}
|
|
|
|
else if (type.IsSameAs(_("Current Settings")))
|
|
|
|
{
|
|
|
|
mPresets->Clear();
|
|
|
|
mPresets->Enable(false);
|
|
|
|
mSelection = Effect::kCurrentSettingsIdent;
|
|
|
|
}
|
|
|
|
else if (type.IsSameAs(_("Factory Defaults")))
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
|
|
|
|
if (type.IsSameAs(_("User Presets")))
|
|
|
|
{
|
|
|
|
selected = mPresets->GetSelection();
|
|
|
|
if (selected == wxNOT_FOUND)
|
|
|
|
{
|
|
|
|
selected = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
mPresets->Clear();
|
|
|
|
mPresets->Append(mUserPresets);
|
|
|
|
mPresets->Enable(true);
|
|
|
|
mPresets->SetSelection(selected);
|
|
|
|
mSelection = Effect::kUserPresetIdent + mPresets->GetString(selected);
|
|
|
|
}
|
|
|
|
else if (type.IsSameAs(_("Factory Presets")))
|
|
|
|
{
|
|
|
|
selected = mPresets->GetSelection();
|
|
|
|
if (selected == wxNOT_FOUND)
|
|
|
|
{
|
|
|
|
selected = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
mPresets->Clear();
|
|
|
|
for (size_t i = 0, cnt = mFactoryPresets.GetCount(); i < cnt; i++)
|
|
|
|
{
|
|
|
|
wxString label = mFactoryPresets[i];
|
|
|
|
if (label.IsEmpty())
|
|
|
|
{
|
|
|
|
label = _("None");
|
|
|
|
}
|
|
|
|
mPresets->Append(label);
|
|
|
|
}
|
|
|
|
mPresets->Enable(true);
|
|
|
|
mPresets->SetSelection(selected);
|
|
|
|
mSelection = Effect::kFactoryPresetIdent + mPresets->GetString(selected);
|
|
|
|
}
|
|
|
|
else if (type.IsSameAs(_("Current Settings")))
|
|
|
|
{
|
|
|
|
mPresets->Clear();
|
|
|
|
mPresets->Enable(false);
|
|
|
|
mSelection = Effect::kCurrentSettingsIdent;
|
|
|
|
}
|
|
|
|
else if (type.IsSameAs(_("Factory Defaults")))
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|