2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
EffectManager.cpp
|
|
|
|
|
|
|
|
Audacity(R) is copyright (c) 1999-2008 Audacity Team.
|
|
|
|
License: GPL v2. See License.txt.
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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 <wx/stopwatch.h>
|
|
|
|
#include <wx/tokenzr.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 "../Experimental.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
|
|
|
#if defined(EXPERIMENTAL_EFFECTS_RACK)
|
|
|
|
#include "EffectRack.h"
|
|
|
|
#endif
|
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 "EffectManager.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
|
|
|
// Create singleton and return reference
|
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
|
|
|
// (Thread-safe...no active threading during construction or after destruction)
|
|
|
|
// ============================================================================
|
|
|
|
EffectManager & EffectManager::Get()
|
|
|
|
{
|
2010-01-23 19:44:49 +00:00
|
|
|
static EffectManager em;
|
|
|
|
return em;
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectManager::EffectManager()
|
|
|
|
{
|
|
|
|
#ifdef EFFECT_CATEGORIES
|
|
|
|
mCategories = new CategoryMap();
|
|
|
|
mRootCategories = new CategorySet();
|
|
|
|
mUnsorted = new EffectSet();
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
|
|
|
|
// Create effect category graph. These categories and relationships
|
|
|
|
// are taken from revision 2 of lv2.ttl, loaders for other plugin systems
|
|
|
|
// (such as LADSPA/LRDF) should map their categories to these ones when
|
|
|
|
// applicable. Individual LADSPA/LRDF and LV2 plugins can add new
|
|
|
|
// categories and make them subcategories of the existing ones, but not
|
|
|
|
// add subcategory relationships between these categories.
|
|
|
|
//
|
|
|
|
// We need some persistent, global identifiers for categories - LRDF
|
|
|
|
// and LV2 uses URI strings so we do that too. The URIs here are the
|
|
|
|
// same ones as in lv2.ttl. Category identifiers in other plugin systems
|
|
|
|
// must be mapped to URIs by their loaders.
|
|
|
|
|
|
|
|
#define LV2PREFIX "http://lv2plug.in/ns/lv2core#"
|
|
|
|
|
|
|
|
typedef EffectCategory* CatPtr;
|
|
|
|
|
|
|
|
CatPtr gen = AddCategory(wxT(LV2PREFIX) wxT("GeneratorPlugin"),
|
|
|
|
_("Generator"));
|
|
|
|
CatPtr inst = AddCategory(wxT(LV2PREFIX) wxT("InstrumentPlugin"),
|
|
|
|
/* i18n-hint: (noun).*/
|
|
|
|
_("Instrument"));
|
|
|
|
CatPtr osc = AddCategory(wxT(LV2PREFIX) wxT("OscillatorPlugin"),
|
|
|
|
_("Oscillator"));
|
|
|
|
CatPtr util = AddCategory(wxT(LV2PREFIX) wxT("UtilityPlugin"),
|
|
|
|
_("Utility"));
|
|
|
|
CatPtr conv = AddCategory(wxT(LV2PREFIX) wxT("ConverterPlugin"),
|
|
|
|
_("Converter"));
|
|
|
|
CatPtr anal = AddCategory(wxT(LV2PREFIX) wxT("AnalyserPlugin"),
|
|
|
|
_("Analyser"));
|
|
|
|
CatPtr mix = AddCategory(wxT(LV2PREFIX) wxT("MixerPlugin"),
|
|
|
|
_("Mixer"));
|
|
|
|
CatPtr sim = AddCategory(wxT(LV2PREFIX) wxT("SimulatorPlugin"),
|
|
|
|
_("Simulator"));
|
|
|
|
CatPtr del = AddCategory(wxT(LV2PREFIX) wxT("DelayPlugin"),
|
|
|
|
_("Delay"));
|
|
|
|
CatPtr mod = AddCategory(wxT(LV2PREFIX) wxT("ModulatorPlugin"),
|
|
|
|
_("Modulator"));
|
|
|
|
CatPtr rev = AddCategory(wxT(LV2PREFIX) wxT("ReverbPlugin"),
|
|
|
|
_("Reverb"));
|
|
|
|
CatPtr phas = AddCategory(wxT(LV2PREFIX) wxT("PhaserPlugin"),
|
|
|
|
_("Phaser"));
|
|
|
|
CatPtr flng = AddCategory(wxT(LV2PREFIX) wxT("FlangerPlugin"),
|
|
|
|
_("Flanger"));
|
|
|
|
CatPtr chor = AddCategory(wxT(LV2PREFIX) wxT("ChorusPlugin"),
|
|
|
|
_("Chorus"));
|
|
|
|
CatPtr flt = AddCategory(wxT(LV2PREFIX) wxT("FilterPlugin"),
|
|
|
|
_("Filter"));
|
|
|
|
CatPtr lp = AddCategory(wxT(LV2PREFIX) wxT("LowpassPlugin"),
|
|
|
|
_("Lowpass"));
|
|
|
|
CatPtr bp = AddCategory(wxT(LV2PREFIX) wxT("BandpassPlugin"),
|
|
|
|
_("Bandpass"));
|
|
|
|
CatPtr hp = AddCategory(wxT(LV2PREFIX) wxT("HighpassPlugin"),
|
|
|
|
_("Highpass"));
|
|
|
|
CatPtr comb = AddCategory(wxT(LV2PREFIX) wxT("CombPlugin"),
|
|
|
|
_("Comb"));
|
|
|
|
CatPtr alp = AddCategory(wxT(LV2PREFIX) wxT("AllpassPlugin"),
|
|
|
|
_("Allpass"));
|
|
|
|
CatPtr eq = AddCategory(wxT(LV2PREFIX) wxT("EQPlugin"),
|
|
|
|
_("Equaliser"));
|
|
|
|
CatPtr peq = AddCategory(wxT(LV2PREFIX) wxT("ParaEQPlugin"),
|
|
|
|
_("Parametric"));
|
|
|
|
CatPtr meq = AddCategory(wxT(LV2PREFIX) wxT("MultiEQPlugin"),
|
|
|
|
_("Multiband"));
|
|
|
|
CatPtr spec = AddCategory(wxT(LV2PREFIX) wxT("SpectralPlugin"),
|
|
|
|
_("Spectral Processor"));
|
|
|
|
CatPtr ptch = AddCategory(wxT(LV2PREFIX) wxT("PitchPlugin"),
|
|
|
|
_("Pitch Shifter"));
|
|
|
|
CatPtr amp = AddCategory(wxT(LV2PREFIX) wxT("AmplifierPlugin"),
|
|
|
|
_("Amplifier"));
|
|
|
|
CatPtr dist = AddCategory(wxT(LV2PREFIX) wxT("DistortionPlugin"),
|
|
|
|
_("Distortion"));
|
|
|
|
CatPtr shp = AddCategory(wxT(LV2PREFIX) wxT("WaveshaperPlugin"),
|
|
|
|
_("Waveshaper"));
|
|
|
|
CatPtr dyn = AddCategory(wxT(LV2PREFIX) wxT("DynamicsPlugin"),
|
|
|
|
_("Dynamics Processor"));
|
|
|
|
CatPtr cmp = AddCategory(wxT(LV2PREFIX) wxT("CompressorPlugin"),
|
|
|
|
_("Compressor"));
|
|
|
|
CatPtr exp = AddCategory(wxT(LV2PREFIX) wxT("ExpanderPlugin"),
|
|
|
|
_("Expander"));
|
|
|
|
CatPtr lim = AddCategory(wxT(LV2PREFIX) wxT("LimiterPlugin"),
|
|
|
|
_("Limiter"));
|
|
|
|
CatPtr gate = AddCategory(wxT(LV2PREFIX) wxT("GatePlugin"),
|
|
|
|
_("Gate"));
|
|
|
|
|
|
|
|
AddCategoryParent(inst, gen);
|
|
|
|
AddCategoryParent(osc, gen);
|
|
|
|
AddCategoryParent(conv, util);
|
|
|
|
AddCategoryParent(anal, util);
|
|
|
|
AddCategoryParent(mix, util);
|
|
|
|
AddCategoryParent(rev, sim);
|
|
|
|
AddCategoryParent(rev, del);
|
|
|
|
AddCategoryParent(phas, mod);
|
|
|
|
AddCategoryParent(flng, mod);
|
|
|
|
AddCategoryParent(chor, mod);
|
|
|
|
AddCategoryParent(lp, flt);
|
|
|
|
AddCategoryParent(bp, flt);
|
|
|
|
AddCategoryParent(hp, flt);
|
|
|
|
AddCategoryParent(comb, flt);
|
|
|
|
AddCategoryParent(alp, flt);
|
|
|
|
AddCategoryParent(eq, flt);
|
|
|
|
AddCategoryParent(peq, eq);
|
|
|
|
AddCategoryParent(meq, eq);
|
|
|
|
AddCategoryParent(ptch, spec);
|
|
|
|
AddCategoryParent(shp, dist);
|
|
|
|
AddCategoryParent(cmp, dyn);
|
|
|
|
AddCategoryParent(exp, dyn);
|
|
|
|
AddCategoryParent(lim, dyn);
|
|
|
|
AddCategoryParent(gate, dyn);
|
|
|
|
// We also add a couple of categories for internal use. These are not
|
|
|
|
// in lv2.ttl.
|
|
|
|
|
|
|
|
#define ATEAM "http://audacityteam.org/namespace#"
|
|
|
|
|
|
|
|
CatPtr nrm = AddCategory(wxT(ATEAM) wxT("NoiseRemoval"),
|
|
|
|
_("Noise Removal"));
|
|
|
|
CatPtr pnt = AddCategory(wxT(ATEAM) wxT("PitchAndTempo"),
|
|
|
|
_("Pitch and Tempo"));
|
|
|
|
CatPtr tim = AddCategory(wxT(ATEAM) wxT("TimelineChanger"),
|
|
|
|
_("Timeline Changer"));
|
|
|
|
CatPtr aTim = AddCategory(wxT(ATEAM) wxT("TimeAnalyser"),
|
|
|
|
_("Time"));
|
|
|
|
CatPtr onst = AddCategory(wxT(ATEAM) wxT("OnsetDetector"),
|
|
|
|
_("Onsets"));
|
|
|
|
AddCategoryParent(nrm, util);
|
|
|
|
AddCategoryParent(tim, util);
|
|
|
|
AddCategoryParent(aTim, anal);
|
|
|
|
AddCategoryParent(onst, aTim);
|
|
|
|
|
|
|
|
// We freeze the internal subcategory relations between the categories
|
|
|
|
// added so far so LADSPA/LRDF or other category systems don't ruin
|
|
|
|
// our hierarchy.
|
|
|
|
FreezeCategories();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
|
2014-11-03 06:48:54 +00:00
|
|
|
mRealtimeLock.Enter();
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
mRealtimeEffects = NULL;
|
|
|
|
mRealtimeCount = 0;
|
2014-11-05 07:06:38 +00:00
|
|
|
mRealtimeActive = false;
|
2014-11-03 06:48:54 +00:00
|
|
|
mRealtimeSuspended = 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
|
|
|
mRealtimeLatency = 0;
|
2014-11-03 06:48:54 +00:00
|
|
|
mRealtimeLock.Leave();
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(EXPERIMENTAL_EFFECTS_RACK)
|
|
|
|
mRack = NULL;
|
2010-01-23 19:44:49 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectManager::~EffectManager()
|
|
|
|
{
|
|
|
|
#ifdef EFFECT_CATEGORIES
|
|
|
|
CategoryMap::iterator i;
|
|
|
|
for (i = mCategories->begin(); i != mCategories->end(); ++i)
|
|
|
|
delete i->second;
|
|
|
|
|
|
|
|
delete mUnsorted;
|
|
|
|
delete mRootCategories;
|
|
|
|
delete mCategories;
|
|
|
|
#endif
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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 defined(EXPERIMENTAL_REALTIME_EFFECTS)
|
|
|
|
if (mRealtimeEffects)
|
|
|
|
{
|
|
|
|
delete [] mRealtimeEffects;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(EXPERIMENTAL_EFFECTS_RACK)
|
|
|
|
// wxWidgets has already destroyed the rack since it was derived from wxFrame. So
|
|
|
|
// no need to delete it here.
|
|
|
|
#endif
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void EffectManager::RegisterEffect(Effect *f, int NewFlags)
|
|
|
|
{
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
f->SetEffectID(mNumEffects++);
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
if( NewFlags != 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
|
|
|
{
|
2010-01-23 19:44:49 +00:00
|
|
|
f->SetEffectFlags( NewFlags );
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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
|
|
|
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
// This will go away after all effects have been converted
|
|
|
|
mEffectPlugins.Add(PluginManager::Get().RegisterLegacyEffectPlugin(f));
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
#ifdef EFFECT_CATEGORIES
|
|
|
|
// Add the effect in the right categories
|
|
|
|
std::set<wxString> catUris = f->GetEffectCategories();
|
|
|
|
bool oneValid = false;
|
|
|
|
std::set<wxString>::const_iterator iter;
|
|
|
|
for (iter = catUris.begin(); iter != catUris.end(); ++iter) {
|
|
|
|
EffectCategory* cat = LookupCategory(*iter);
|
|
|
|
if (cat != 0) {
|
|
|
|
cat->AddEffect(f);
|
|
|
|
oneValid = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!oneValid)
|
|
|
|
mUnsorted->insert(f);
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectManager::UnregisterEffects()
|
|
|
|
{
|
|
|
|
#ifdef EFFECT_CATEGORIES
|
|
|
|
mUnsorted->clear();
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
CategoryMap::iterator iter;
|
|
|
|
for (iter = mCategories->begin(); iter != mCategories->end(); ++iter)
|
|
|
|
iter->second->mEffects.clear();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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 EffectManager::DoEffect(const PluginID & ID,
|
|
|
|
wxWindow *parent,
|
|
|
|
int flags,
|
|
|
|
double projectRate,
|
|
|
|
TrackList *list,
|
|
|
|
TrackFactory *factory,
|
|
|
|
SelectedRegion *selectedRegion,
|
|
|
|
wxString params)
|
|
|
|
{
|
|
|
|
Effect *effect = GetEffect(ID);
|
|
|
|
|
|
|
|
if (!effect)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(EXPERIMENTAL_REALTIME_EFFECTS) && defined(EXPERIMENTAL_EFFECTS_RACK)
|
|
|
|
if (effect->IsRealtimeCapable())
|
|
|
|
{
|
|
|
|
GetRack()->Add(effect);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return effect->DoEffect(parent,
|
|
|
|
flags,
|
|
|
|
projectRate,
|
|
|
|
list,
|
|
|
|
factory,
|
|
|
|
selectedRegion,
|
|
|
|
params);
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString EffectManager::GetEffectName(const PluginID & ID)
|
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
|
|
|
return PluginManager::Get().GetName(ID);
|
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
|
|
|
wxString EffectManager::GetEffectIdentifier(const PluginID & ID)
|
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
|
|
|
wxString name = (PluginManager::Get().GetName(ID));
|
|
|
|
|
|
|
|
// Get rid of leading and trailing white space
|
|
|
|
name.Trim(true).Trim(false);
|
|
|
|
|
|
|
|
if (name == wxEmptyString)
|
|
|
|
{
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
wxStringTokenizer st(name, wxT(" "));
|
|
|
|
wxString id;
|
|
|
|
|
|
|
|
// CamelCase the name
|
|
|
|
while (st.HasMoreTokens())
|
|
|
|
{
|
|
|
|
wxString tok = st.GetNextToken();
|
2014-06-03 20:30:19 +00:00
|
|
|
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
id += tok.Left(1).MakeUpper() + tok.Mid(1).MakeLower();
|
|
|
|
}
|
|
|
|
|
|
|
|
return id;
|
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
|
|
|
wxString EffectManager::GetEffectDescription(const PluginID & ID)
|
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
|
|
|
Effect *effect = GetEffect(ID);
|
|
|
|
|
|
|
|
if (effect)
|
|
|
|
{
|
|
|
|
return effect->GetEffectDescription();
|
|
|
|
}
|
|
|
|
|
|
|
|
return wxEmptyString;
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString EffectManager::GetEffectParameters(const PluginID & ID)
|
|
|
|
{
|
|
|
|
Effect *effect = GetEffect(ID);
|
|
|
|
|
|
|
|
if (effect)
|
|
|
|
{
|
|
|
|
ShuttleCli shuttle;
|
|
|
|
shuttle.mbStoreInClient = false;
|
|
|
|
effect->TransferParameters(shuttle);
|
|
|
|
return shuttle.mParams;
|
|
|
|
}
|
|
|
|
|
|
|
|
return wxEmptyString;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectManager::SetEffectParameters(const PluginID & ID, const wxString & params)
|
|
|
|
{
|
|
|
|
Effect *effect = GetEffect(ID);
|
|
|
|
|
|
|
|
if (effect)
|
|
|
|
{
|
|
|
|
ShuttleCli shuttle;
|
|
|
|
shuttle.mParams = params;
|
|
|
|
shuttle.mbStoreInClient=true;
|
|
|
|
return effect->TransferParameters(shuttle);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectManager::PromptUser(const PluginID & ID, wxWindow *parent)
|
|
|
|
{
|
|
|
|
Effect *effect = GetEffect(ID);
|
|
|
|
bool result = false;
|
|
|
|
|
|
|
|
if (effect)
|
|
|
|
{
|
|
|
|
result = effect->PromptUser(parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(EXPERIMENTAL_EFFECTS_RACK)
|
|
|
|
EffectRack *EffectManager::GetRack()
|
|
|
|
{
|
|
|
|
if (!mRack)
|
|
|
|
{
|
|
|
|
mRack = new EffectRack();
|
2014-10-27 21:47:28 +00:00
|
|
|
mRack->CenterOnParent();
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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 mRack;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectManager::ShowRack()
|
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
GetRack()->Show(!GetRack()->IsShown());
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
|
2014-11-03 06:48:54 +00:00
|
|
|
void EffectManager::RealtimeSetEffects(const EffectArray & effects)
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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
|
|
|
int newCount = (int) effects.GetCount();
|
|
|
|
Effect **newEffects = new Effect *[newCount];
|
|
|
|
for (int i = 0; i < newCount; i++)
|
|
|
|
{
|
|
|
|
newEffects[i] = effects[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Block RealtimeProcess()
|
|
|
|
RealtimeSuspend();
|
|
|
|
|
|
|
|
// Tell any effects no longer in the chain to clean up
|
|
|
|
for (int i = 0; i < mRealtimeCount; i++)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
Effect *e = mRealtimeEffects[i];
|
2014-10-30 14:04:48 +00:00
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
// Scan the new chain for the effect
|
|
|
|
for (int j = 0; j < newCount; j++)
|
2014-10-30 14:04:48 +00:00
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
// Found it so we're done
|
|
|
|
if (e == newEffects[j])
|
2014-10-30 14:04:48 +00:00
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
e = NULL;
|
|
|
|
break;
|
2014-10-30 14:04:48 +00:00
|
|
|
}
|
2014-11-03 06:48:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Must not have been in the new chain, so tell it to cleanup
|
2014-11-05 07:06:38 +00:00
|
|
|
if (e && mRealtimeActive)
|
2014-11-03 06:48:54 +00:00
|
|
|
{
|
|
|
|
e->RealtimeFinalize();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tell any new effects to get ready
|
|
|
|
for (int i = 0; i < newCount; i++)
|
|
|
|
{
|
|
|
|
Effect *e = newEffects[i];
|
|
|
|
|
|
|
|
// Scan the old chain for the effect
|
|
|
|
for (int j = 0; j < mRealtimeCount; j++)
|
|
|
|
{
|
|
|
|
// Found it so tell effect to get ready
|
|
|
|
if (e == mRealtimeEffects[j])
|
2014-10-30 14:04:48 +00:00
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
e = NULL;
|
2014-10-30 14:04:48 +00:00
|
|
|
}
|
|
|
|
}
|
2014-11-03 06:48:54 +00:00
|
|
|
|
|
|
|
// Must not have been in the old chain, so tell it to initialize
|
2014-11-05 07:06:38 +00:00
|
|
|
if (e && mRealtimeActive)
|
2014-11-03 06:48:54 +00:00
|
|
|
{
|
|
|
|
e->RealtimeInitialize();
|
|
|
|
}
|
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
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
// Get rid of the old chain
|
|
|
|
if (mRealtimeEffects)
|
|
|
|
{
|
|
|
|
delete [] mRealtimeEffects;
|
|
|
|
}
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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
|
|
|
// And install the new one
|
|
|
|
mRealtimeEffects = newEffects;
|
|
|
|
mRealtimeCount = newCount;
|
2014-10-30 14:04:48 +00:00
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
// Allow RealtimeProcess() to, well, process
|
|
|
|
RealtimeResume();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void EffectManager::RealtimeInitialize()
|
|
|
|
{
|
|
|
|
// No need to do anything if there are no effects
|
|
|
|
if (!mRealtimeCount)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// The audio thread should not be running yet, but protect anyway
|
|
|
|
RealtimeSuspend();
|
|
|
|
|
2014-11-05 07:06:38 +00:00
|
|
|
// RealtimeSetEffects() needs to know when we're active so it can
|
|
|
|
// initialize newly added effects
|
|
|
|
mRealtimeActive = true;
|
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
// Tell each effect to get ready for action
|
|
|
|
for (int i = 0; i < mRealtimeCount; i++)
|
|
|
|
{
|
|
|
|
mRealtimeEffects[i]->RealtimeInitialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get things moving
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
RealtimeResume();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectManager::RealtimeFinalize()
|
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
// Make sure nothing is going on
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
RealtimeSuspend();
|
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
// It is now safe to clean up
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
mRealtimeLatency = 0;
|
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
// Tell each effect to clean up as well
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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 (int i = 0; i < mRealtimeCount; i++)
|
|
|
|
{
|
|
|
|
mRealtimeEffects[i]->RealtimeFinalize();
|
|
|
|
}
|
2014-11-05 07:06:38 +00:00
|
|
|
|
|
|
|
mRealtimeActive = 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
|
|
|
}
|
|
|
|
|
|
|
|
void EffectManager::RealtimeSuspend()
|
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
mRealtimeLock.Enter();
|
|
|
|
|
|
|
|
// Already suspended...bail
|
|
|
|
if (mRealtimeSuspended)
|
|
|
|
{
|
|
|
|
mRealtimeLock.Leave();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Show that we aren't going to be doing anything
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
mRealtimeSuspended = true;
|
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
// And make sure the effects don't either
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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 (int i = 0; i < mRealtimeCount; i++)
|
|
|
|
{
|
|
|
|
mRealtimeEffects[i]->RealtimeSuspend();
|
|
|
|
}
|
2014-11-03 06:48:54 +00:00
|
|
|
|
|
|
|
mRealtimeLock.Leave();
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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 EffectManager::RealtimeResume()
|
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
mRealtimeLock.Enter();
|
|
|
|
|
|
|
|
// Already running...bail
|
|
|
|
if (!mRealtimeSuspended)
|
|
|
|
{
|
|
|
|
mRealtimeLock.Leave();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tell the effects to get ready for more action
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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 (int i = 0; i < mRealtimeCount; i++)
|
|
|
|
{
|
|
|
|
mRealtimeEffects[i]->RealtimeResume();
|
|
|
|
}
|
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
// And we should too
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
mRealtimeSuspended = false;
|
2014-11-03 06:48:54 +00:00
|
|
|
|
|
|
|
mRealtimeLock.Leave();
|
2010-01-23 19:44:49 +00:00
|
|
|
}
|
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
//
|
|
|
|
// This will be called in a different thread than the main GUI thread.
|
|
|
|
//
|
|
|
|
sampleCount EffectManager::RealtimeProcess(int group, int chans, float rate, float **buffers, sampleCount numSamples)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
// Protect ourselves from the main thread
|
|
|
|
mRealtimeLock.Enter();
|
|
|
|
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
// Can be suspended because of the audio stream being paused or because effects
|
2014-11-03 06:48:54 +00:00
|
|
|
// have been suspended, so allow the samples to pass as-is.
|
|
|
|
if (mRealtimeSuspended || mRealtimeCount == 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
|
|
|
mRealtimeLock.Leave();
|
|
|
|
return 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
|
|
|
// Remember when we started so we can calculate the amount of latency we
|
|
|
|
// are introducing
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
wxMilliClock_t start = wxGetLocalTimeMillis();
|
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
// Allocate the in/out buffer arrays
|
|
|
|
float **ibuf = (float **) alloca(chans * sizeof(float *));
|
|
|
|
float **obuf = (float **) alloca(chans * sizeof(float *));
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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
|
|
|
// And populate the input with the buffers we've been given while allocating
|
|
|
|
// new output buffers
|
|
|
|
for (int i = 0; i < chans; i++)
|
|
|
|
{
|
|
|
|
ibuf[i] = buffers[i];
|
|
|
|
obuf[i] = (float *) alloca(numSamples * sizeof(float));
|
|
|
|
}
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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
|
|
|
// Now call each effect in the chain while swapping buffer pointers to feed the
|
|
|
|
// output of one effect as the input to the next effect
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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 (int i = 0; i < mRealtimeCount; i++)
|
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
mRealtimeEffects[i]->RealtimeProcess(group, chans, rate, ibuf, obuf, 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
|
|
|
for (int j = 0; j < chans; j++)
|
|
|
|
{
|
|
|
|
float *temp;
|
|
|
|
temp = ibuf[j];
|
|
|
|
ibuf[j] = obuf[j];
|
|
|
|
obuf[j] = temp;
|
|
|
|
}
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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
|
|
|
// Once we're done, we might wind up with the last effect storing its results
|
|
|
|
// in the temporary buffers. If that's the case, we need to copy it over to
|
|
|
|
// the caller's buffers. This happens when the number of effects is odd.
|
|
|
|
if (mRealtimeCount & 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
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
for (int i = 0; i < chans; i++)
|
|
|
|
{
|
|
|
|
memcpy(buffers[i], ibuf[i], numSamples * sizeof(float));
|
|
|
|
}
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there 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
|
|
|
// Remember the latency
|
The fabled realtime effects...
I've made it where you can enable and disable via experimentals:
EXPERIMENTAL_REALTIME_EFFECTS
EXPERIMENTAL_EFFECTS_RACK
You will notice that, as of now, the only effects currently set up for
realtime are VSTs. Now that this is in, I will start converting the
rest.
As I start to convert the effects, the astute of you may notice that
they no longer directly access tracks or any "internal" Audacity
objects. This isolates the effects from changes in Audacity and makes
it much easier to add new ones.
Anyway, all 3 platforms can now display VST effects in graphical mode.
Yes, that means Linux too. There are quite a few VSTs for Linux if
you search for them.
The so-called "rack" definitely needs some discussion, work, and attention
from someone much better at graphics than me. I'm not really sure it should
stay in as-is. I'd originally planned for it to be simply a utility window
where you can store your (preconfigured) favorite effects. It should probably
revert back to that idea.
You may notice that this DOES include the API work I did. The realtime effects
were too tied to it and I didn't want to redo the whole thing. As I mentioned
elsewhere, the API stuff may or may not be very future proof.
So, let the critter complaints commence. I absolute KNOW there will be some.
(I know I'll be hearing from the Linux peeps pretty darn quickly. ;-))
2014-10-26 03:24:10 +00:00
|
|
|
mRealtimeLatency = (int) (wxGetLocalTimeMillis() - start).GetValue();
|
2014-10-30 14:04:48 +00:00
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
mRealtimeLock.Leave();
|
|
|
|
|
2014-10-30 14:04:48 +00:00
|
|
|
//
|
|
|
|
// This is wrong...needs to handle tails
|
|
|
|
//
|
|
|
|
return 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
|
|
|
}
|
|
|
|
|
|
|
|
int EffectManager::GetRealtimeLatency()
|
|
|
|
{
|
|
|
|
return mRealtimeLatency;
|
|
|
|
}
|
|
|
|
|
|
|
|
Effect *EffectManager::GetEffect(const PluginID & ID)
|
|
|
|
{
|
|
|
|
Effect *effect;
|
|
|
|
|
|
|
|
// TODO: This is temporary and should be redone when all effects are converted
|
|
|
|
if (mEffectPlugins.Index(wxString(ID)) == wxNOT_FOUND)
|
|
|
|
{
|
|
|
|
// This will instantiate the effect client if it hasn't already been done
|
|
|
|
EffectClientInterface *client = static_cast<EffectClientInterface *>(PluginManager::Get().GetInstance(ID));
|
|
|
|
if (client)
|
|
|
|
{
|
|
|
|
effect = new Effect(client);
|
|
|
|
if (effect)
|
|
|
|
{
|
|
|
|
effect->SetEffectID(mNumEffects++);
|
|
|
|
PluginManager::Get().SetInstance(ID, effect);
|
|
|
|
mEffectPlugins.Add(ID);
|
|
|
|
}
|
|
|
|
|
|
|
|
return effect;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return static_cast<Effect *>(PluginManager::Get().GetInstance(ID));
|
|
|
|
}
|
|
|
|
|
|
|
|
const PluginID & EffectManager::GetEffectByIdentifier(const wxString & strTarget)
|
|
|
|
{
|
|
|
|
if (strTarget == wxEmptyString) // set GetEffectIdentifier to wxT("") to not show an effect in Batch mode
|
|
|
|
{
|
2014-11-03 06:48:54 +00:00
|
|
|
return PluginID(wxString(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
|
|
|
}
|
|
|
|
|
|
|
|
PluginManager & pm = PluginManager::Get();
|
|
|
|
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect);
|
|
|
|
while (plug)
|
|
|
|
{
|
|
|
|
if (GetEffectIdentifier(plug->GetID()).IsSameAs(strTarget))
|
|
|
|
{
|
|
|
|
return plug->GetID();
|
|
|
|
}
|
|
|
|
plug = pm.GetNextPlugin(PluginTypeEffect);
|
|
|
|
}
|
|
|
|
|
2014-11-03 06:48:54 +00:00
|
|
|
return PluginID(wxString(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
|
|
|
}
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
#ifdef EFFECT_CATEGORIES
|
|
|
|
|
2014-06-03 20:30:19 +00:00
|
|
|
EffectCategory* EffectManager::AddCategory(const wxString& URI,
|
2010-01-23 19:44:49 +00:00
|
|
|
const wxString& name) {
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
CategoryMap::const_iterator iter = mCategories->find(URI);
|
|
|
|
if (iter != mCategories->end())
|
|
|
|
return iter->second;
|
|
|
|
EffectCategory* cat = new EffectCategory(URI, name);
|
|
|
|
mCategories->insert(std::make_pair(URI, cat));
|
|
|
|
mRootCategories->insert(cat);
|
|
|
|
return cat;
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectCategory* EffectManager::LookupCategory(const wxString& URI) {
|
|
|
|
CategoryMap::const_iterator iter = mCategories->find(URI);
|
|
|
|
if (iter != mCategories->end())
|
|
|
|
return iter->second;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectManager::AddCategoryParent(EffectCategory* child,
|
|
|
|
EffectCategory* parent) {
|
|
|
|
bool result = child->AddParent(parent);
|
|
|
|
if (!result)
|
|
|
|
return false;
|
|
|
|
CategorySet::iterator iter = mRootCategories->find(child);
|
|
|
|
if (iter != mRootCategories->end())
|
|
|
|
mRootCategories->erase(iter);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectManager::FreezeCategories() {
|
|
|
|
CategoryMap::iterator iter;
|
|
|
|
for (iter = mCategories->begin(); iter != mCategories->end(); ++iter)
|
|
|
|
iter->second->FreezeParents();
|
|
|
|
}
|
|
|
|
|
|
|
|
const CategorySet& EffectManager::GetRootCategories() const {
|
|
|
|
return *mRootCategories;
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectSet EffectManager::GetUnsortedEffects(int flags) const {
|
|
|
|
|
|
|
|
if (flags == ALL_EFFECTS)
|
|
|
|
return *mUnsorted;
|
|
|
|
|
|
|
|
EffectSet result;
|
|
|
|
EffectSet::const_iterator iter;
|
|
|
|
for (iter = mUnsorted->begin(); iter != mUnsorted->end(); ++iter) {
|
|
|
|
int g = (*iter)->GetEffectFlags();
|
|
|
|
if ((flags & g) == g)
|
|
|
|
result.insert(*iter);
|
|
|
|
}
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|