audacia/src/effects/EffectManager.cpp

969 lines
23 KiB
C++
Raw Normal View History

/**********************************************************************
Audacity: A Digital Audio Editor
EffectManager.cpp
Audacity(R) is copyright (c) 1999-2008 Audacity Team.
License: GPL v2. See License.txt.
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
******************************************************************//**
\class EffectManager
\brief EffectManager is the class that handles effects and effect categories.
It maintains a graph of effect categories and subcategories,
registers and unregisters effects and can return filtered lists of
effects.
*//*******************************************************************/
#include "../Audacity.h"
#include <algorithm>
#include <wx/stopwatch.h>
#include <wx/tokenzr.h>
#include "../Experimental.h"
#include "../widgets/ErrorDialog.h"
#if defined(EXPERIMENTAL_EFFECTS_RACK)
#include "EffectRack.h"
#endif
#include "EffectManager.h"
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
#include "../commands/Command.h"
#include "../commands/CommandContext.h"
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
/*******************************************************************************
Creates a singleton and returns reference
(Thread-safe...no active threading during construction or after destruction)
*******************************************************************************/
EffectManager & EffectManager::Get()
{
static EffectManager em;
return em;
}
EffectManager::EffectManager()
{
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
mRealtimeLock.Enter();
mRealtimeActive = false;
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
mRealtimeSuspended = true;
mRealtimeLatency = 0;
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
mRealtimeLock.Leave();
mSkipStateFlag = false;
#if defined(EXPERIMENTAL_EFFECTS_RACK)
mRack = NULL;
#endif
}
EffectManager::~EffectManager()
{
#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
}
// Here solely for the purpose of Nyquist Workbench until
// a better solution is devised.
2015-05-28 14:57:59 +00:00
const PluginID & EffectManager::RegisterEffect(Effect *f)
{
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
const PluginID & ID = PluginManager::Get().RegisterPlugin(f, PluginTypeEffect);
2015-05-28 14:57:59 +00:00
mEffects[ID] = f;
return ID;
}
// Here solely for the purpose of Nyquist Workbench until
// a better solution is devised.
void EffectManager::UnregisterEffect(const PluginID & ID)
{
PluginID id = ID;
PluginManager::Get().UnregisterPlugin(id);
mEffects.erase(id);
}
bool EffectManager::DoEffect(const PluginID & ID,
wxWindow *parent,
double projectRate,
TrackList *list,
TrackFactory *factory,
SelectedRegion *selectedRegion,
bool shouldPrompt /* = true */)
{
this->SetSkipStateFlag(false);
Effect *effect = GetEffect(ID);
if (!effect)
{
return false;
}
#if defined(EXPERIMENTAL_EFFECTS_RACK)
if (effect->SupportsRealtime())
{
GetRack()->Add(effect);
}
#endif
bool res = effect->DoEffect(parent,
projectRate,
list,
factory,
selectedRegion,
shouldPrompt);
return res;
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
bool EffectManager::DoAudacityCommand(const PluginID & ID,
const CommandContext &context,
wxWindow *parent,
bool shouldPrompt /* = true */)
{
this->SetSkipStateFlag(false);
AudacityCommand *command = GetAudacityCommand(ID);
if (!command)
{
return false;
}
bool res = command->DoAudacityCommand(parent, context, shouldPrompt);
return res;
}
IdentInterfaceSymbol EffectManager::GetCommandSymbol(const PluginID & ID)
{
return PluginManager::Get().GetSymbol(ID);
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
wxString EffectManager::GetCommandName(const PluginID & ID)
{
return GetCommandSymbol(ID).Translation();
}
wxString EffectManager::GetEffectFamilyName(const PluginID & ID)
{
auto effect = GetEffect(ID);
if (effect)
return effect->GetFamilyId().Translation();
return {};
}
wxString EffectManager::GetVendorName(const PluginID & ID)
{
auto effect = GetEffect(ID);
if (effect)
return effect->GetVendor().Translation();
return {};
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
wxString EffectManager::GetCommandIdentifier(const PluginID & ID)
{
wxString name = PluginManager::Get().GetSymbol(ID).Internal();
// 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
id += tok.Left(1).MakeUpper() + tok.Mid(1).MakeLower();
}
return id;
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
wxString EffectManager::GetCommandDescription(const PluginID & ID)
{
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
if (GetEffect(ID))
return wxString::Format(_("Applied effect: %s"), GetCommandName(ID));
if (GetAudacityCommand(ID))
return wxString::Format(_("Applied command: %s"), GetCommandName(ID));
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
return wxEmptyString;
}
2018-02-10 14:11:31 +00:00
wxString EffectManager::GetCommandUrl(const PluginID & ID)
{
Effect* pEff = GetEffect(ID);
if( pEff )
return pEff->ManualPage();
AudacityCommand * pCom = GetAudacityCommand(ID);
if( pCom )
return pCom->ManualPage();
return wxEmptyString;
}
wxString EffectManager::GetCommandTip(const PluginID & ID)
{
Effect* pEff = GetEffect(ID);
if( pEff )
return pEff->GetDescription();
AudacityCommand * pCom = GetAudacityCommand(ID);
if( pCom )
return pCom->GetDescription();
return wxEmptyString;
}
void EffectManager::GetCommandDefinition(const PluginID & ID, const CommandContext & context, int flags)
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
{
2018-02-08 21:12:49 +00:00
ParamsInterface *command;
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
command = GetEffect(ID);
if( !command )
command = GetAudacityCommand( ID );
if( !command )
2018-02-08 16:22:01 +00:00
return;
ShuttleParams NullShuttle;
// Test if it defines any parameters at all.
bool bHasParams = command->DefineParams( NullShuttle );
if( (flags ==0) && !bHasParams )
2018-02-08 16:22:01 +00:00
return;
// This is capturing the output context into the shuttle.
ShuttleGetDefinition S( *context.pOutput.get()->mStatusTarget.get() );
S.StartStruct();
S.AddItem( GetCommandIdentifier( ID ), "id" );
S.AddItem( GetCommandName( ID ), "name" );
if( bHasParams ){
S.StartField( "params" );
S.StartArray();
command->DefineParams( S );
S.EndArray();
S.EndField();
}
2018-02-10 14:11:31 +00:00
S.AddItem( GetCommandUrl( ID ), "url" );
S.AddItem( GetCommandTip( ID ), "tip" );
2018-02-08 16:22:01 +00:00
S.EndStruct();
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
bool EffectManager::IsHidden(const PluginID & ID)
{
Effect *effect = GetEffect(ID);
if (effect)
{
return effect->IsHidden();
}
return false;
}
void EffectManager::SetSkipStateFlag(bool flag)
{
mSkipStateFlag = flag;
}
bool EffectManager::GetSkipStateFlag()
{
return mSkipStateFlag;
}
bool EffectManager::SupportsAutomation(const PluginID & ID)
{
const PluginDescriptor *plug = PluginManager::Get().GetPlugin(ID);
if (plug)
{
return plug->IsEffectAutomatable();
}
return false;
}
wxString EffectManager::GetEffectParameters(const PluginID & ID)
{
Effect *effect = GetEffect(ID);
if (effect)
{
wxString parms;
effect->GetAutomationParameters(parms);
// Some effects don't have automatable parameters and will not return
// anything, so try to get the active preset (current or factory).
if (parms.IsEmpty())
{
parms = GetDefaultPreset(ID);
}
return parms;
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
AudacityCommand *command = GetAudacityCommand(ID);
if (command)
{
wxString parms;
command->GetAutomationParameters(parms);
// Some effects don't have automatable parameters and will not return
// anything, so try to get the active preset (current or factory).
if (parms.IsEmpty())
{
parms = GetDefaultPreset(ID);
}
return parms;
}
return wxEmptyString;
}
bool EffectManager::SetEffectParameters(const PluginID & ID, const wxString & params)
{
Effect *effect = GetEffect(ID);
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
if (effect)
{
2018-02-21 14:24:25 +00:00
CommandParameters eap(params);
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
if (eap.HasEntry(wxT("Use Preset")))
{
return effect->SetAutomationParameters(eap.Read(wxT("Use Preset")));
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
return effect->SetAutomationParameters(params);
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
AudacityCommand *command = GetAudacityCommand(ID);
if (command)
{
// Set defaults (if not initialised) before setting values.
command->Init();
2018-02-21 14:24:25 +00:00
CommandParameters eap(params);
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
if (eap.HasEntry(wxT("Use Preset")))
{
return command->SetAutomationParameters(eap.Read(wxT("Use Preset")));
}
return command->SetAutomationParameters(params);
}
return false;
}
bool EffectManager::PromptUser(const PluginID & ID, wxWindow *parent)
{
bool result = false;
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
Effect *effect = GetEffect(ID);
if (effect)
{
result = effect->PromptUser(parent);
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
return result;
}
AudacityCommand *command = GetAudacityCommand(ID);
if (command)
{
result = command->PromptUser(parent);
return result;
}
return result;
}
bool EffectManager::HasPresets(const PluginID & ID)
{
Effect *effect = GetEffect(ID);
if (!effect)
{
return false;
}
return effect->GetUserPresets().GetCount() > 0 ||
effect->GetFactoryPresets().GetCount() > 0 ||
effect->HasCurrentSettings() ||
effect->HasFactoryDefaults();
}
wxString EffectManager::GetPreset(const PluginID & ID, const wxString & params, wxWindow * parent)
{
Effect *effect = GetEffect(ID);
if (!effect)
{
return wxEmptyString;
}
2018-02-21 14:24:25 +00:00
CommandParameters eap(params);
wxString preset;
if (eap.HasEntry(wxT("Use Preset")))
{
preset = eap.Read(wxT("Use Preset"));
}
preset = effect->GetPreset(parent, preset);
if (preset.IsEmpty())
{
return preset;
}
eap.DeleteAll();
eap.Write(wxT("Use Preset"), preset);
eap.GetParameters(preset);
return preset;
}
wxString EffectManager::GetDefaultPreset(const PluginID & ID)
{
Effect *effect = GetEffect(ID);
if (!effect)
{
return wxEmptyString;
}
wxString preset;
if (effect->HasCurrentSettings())
{
preset = Effect::kCurrentSettingsIdent;
}
else if (effect->HasFactoryDefaults())
{
preset = Effect::kFactoryDefaultsIdent;
}
if (!preset.IsEmpty())
{
2018-02-21 14:24:25 +00:00
CommandParameters eap;
eap.Write(wxT("Use Preset"), preset);
eap.GetParameters(preset);
}
return preset;
}
void EffectManager::SetBatchProcessing(const PluginID & ID, bool start)
{
Effect *effect = GetEffect(ID);
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
if (effect)
{
effect->SetBatchProcessing(start);
return;
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
AudacityCommand *command = GetAudacityCommand(ID);
if (command)
{
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
command->SetBatchProcessing(start);
return;
}
}
#if defined(EXPERIMENTAL_EFFECTS_RACK)
EffectRack *EffectManager::GetRack()
{
if (!mRack)
{
// EffectRack is constructed with the current project as owner, so safenew is OK
mRack = safenew EffectRack();
// Make sure what I just commented remains true:
wxASSERT(mRack->GetParent());
mRack->CenterOnParent();
}
return mRack;
}
void EffectManager::ShowRack()
{
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
GetRack()->Show(!GetRack()->IsShown());
}
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
void EffectManager::RealtimeSetEffects(const EffectArray & effects)
{
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// Block RealtimeProcess()
RealtimeSuspend();
// Tell any effects no longer in the chain to clean up
for (auto e: mRealtimeEffects)
{
// Scan the NEW chain for the effect
for (auto e1: effects)
{
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// Found it so we're done
if (e == e1)
{
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
e = NULL;
break;
}
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
}
// Must not have been in the NEW chain, so tell it to cleanup
if (e && mRealtimeActive)
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
{
e->RealtimeFinalize();
}
}
// Tell any NEW effects to get ready
for (auto e : effects)
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
{
// Scan the old chain for the effect
for (auto e1 : mRealtimeEffects)
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
{
// Found it so tell effect to get ready
if (e == e1)
{
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
e = NULL;
break;
}
}
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// Must not have been in the old chain, so tell it to initialize
if (e && mRealtimeActive)
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
{
e->RealtimeInitialize();
}
}
// Get rid of the old chain
// And install the NEW one
mRealtimeEffects = effects;
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// Allow RealtimeProcess() to, well, process
RealtimeResume();
}
#endif
bool EffectManager::RealtimeIsActive()
{
return mRealtimeEffects.size() != 0;
}
bool EffectManager::RealtimeIsSuspended()
{
return mRealtimeSuspended;
}
void EffectManager::RealtimeAddEffect(Effect *effect)
{
// Block RealtimeProcess()
RealtimeSuspend();
// Initialize effect if realtime is already active
if (mRealtimeActive)
{
// Initialize realtime processing
effect->RealtimeInitialize();
// Add the required processors
for (size_t i = 0, cnt = mRealtimeChans.size(); i < cnt; i++)
{
effect->RealtimeAddProcessor(i, mRealtimeChans[i], mRealtimeRates[i]);
}
}
// Add to list of active effects
mRealtimeEffects.push_back(effect);
// Allow RealtimeProcess() to, well, process
RealtimeResume();
}
void EffectManager::RealtimeRemoveEffect(Effect *effect)
{
// Block RealtimeProcess()
RealtimeSuspend();
if (mRealtimeActive)
{
// Cleanup realtime processing
effect->RealtimeFinalize();
}
// Remove from list of active effects
auto end = mRealtimeEffects.end();
auto found = std::find(mRealtimeEffects.begin(), end, effect);
if (found != end)
mRealtimeEffects.erase(found);
// Allow RealtimeProcess() to, well, process
RealtimeResume();
}
void EffectManager::RealtimeInitialize(double rate)
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
{
// The audio thread should not be running yet, but protect anyway
RealtimeSuspend();
// (Re)Set processor parameters
mRealtimeChans.clear();
mRealtimeRates.clear();
// RealtimeAdd/RemoveEffect() needs to know when we're active so it can
// initialize newly added effects
mRealtimeActive = true;
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// Tell each effect to get ready for action
for (auto e : mRealtimeEffects) {
e->SetSampleRate(rate);
e->RealtimeInitialize();
}
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// Get things moving
RealtimeResume();
}
void EffectManager::RealtimeAddProcessor(int group, unsigned chans, float rate)
{
for (auto e : mRealtimeEffects)
e->RealtimeAddProcessor(group, chans, rate);
mRealtimeChans.push_back(chans);
mRealtimeRates.push_back(rate);
}
void EffectManager::RealtimeFinalize()
{
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// Make sure nothing is going on
RealtimeSuspend();
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// It is now safe to clean up
mRealtimeLatency = 0;
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// Tell each effect to clean up as well
for (auto e : mRealtimeEffects)
e->RealtimeFinalize();
// Reset processor parameters
mRealtimeChans.clear();
mRealtimeRates.clear();
// No longer active
mRealtimeActive = false;
}
void EffectManager::RealtimeSuspend()
{
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
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
mRealtimeSuspended = true;
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// And make sure the effects don't either
for (auto e : mRealtimeEffects)
e->RealtimeSuspend();
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
mRealtimeLock.Leave();
}
void EffectManager::RealtimeResume()
{
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
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
for (auto e : mRealtimeEffects)
e->RealtimeResume();
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// And we should too
mRealtimeSuspended = false;
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
mRealtimeLock.Leave();
}
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
//
// This will be called in a different thread than the main GUI thread.
//
void EffectManager::RealtimeProcessStart()
{
// Protect ourselves from the main thread
mRealtimeLock.Enter();
// Can be suspended because of the audio stream being paused or because effects
// have been suspended.
if (!mRealtimeSuspended)
{
for (auto e : mRealtimeEffects)
{
if (e->IsRealtimeActive())
e->RealtimeProcessStart();
}
}
mRealtimeLock.Leave();
}
//
// This will be called in a different thread than the main GUI thread.
//
size_t EffectManager::RealtimeProcess(int group, unsigned chans, float **buffers, size_t numSamples)
{
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// Protect ourselves from the main thread
mRealtimeLock.Enter();
// Can be suspended because of the audio stream being paused or because effects
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// have been suspended, so allow the samples to pass as-is.
if (mRealtimeSuspended || mRealtimeEffects.empty())
{
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
mRealtimeLock.Leave();
return numSamples;
}
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// Remember when we started so we can calculate the amount of latency we
// are introducing
wxMilliClock_t start = wxGetUTCTimeMillis();
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
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 *));
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
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 (unsigned int i = 0; i < chans; i++)
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
{
ibuf[i] = buffers[i];
obuf[i] = (float *) alloca(numSamples * sizeof(float));
}
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
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
size_t called = 0;
for (auto e : mRealtimeEffects)
{
if (e->IsRealtimeActive())
{
e->RealtimeProcess(group, chans, ibuf, obuf, numSamples);
called++;
}
for (unsigned int j = 0; j < chans; j++)
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
{
float *temp;
temp = ibuf[j];
ibuf[j] = obuf[j];
obuf[j] = temp;
}
}
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
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 proccessed
// is odd.
if (called & 1)
{
for (unsigned int i = 0; i < chans; i++)
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
{
memcpy(buffers[i], ibuf[i], numSamples * sizeof(float));
}
}
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
// Remember the latency
mRealtimeLatency = (int) (wxGetUTCTimeMillis() - start).GetValue();
Round 3 of realtime changes. This gets meter type VST effects working again by extending the The master now maintains his own internal buffers and sums (mixes) all playing tracks into those buffers. The buffers are then fed into the VST effect that is presented to the user. This allows the effect to provide feedback to the user if it support it. Such effects may display meters or clipping indicators. Several issues with treading have also been corrected (hopefully ;-)). These showed up mostly on Linux, but could have happened on the others as well. The realtime support is no longer limited to 2 channels per logical track. Once support for more channels is added, this should be ready for it. The rack dialog can now be toggled via the edit toolbar button. It doesn't stay pressed because the closing of the dialog would have to be communicated back to the toolbar. As the rack is updated with new or removed effects or active state changed, all effects in the active list were shutdown and all effects in the updated list were initialized. This now shuts down only the effects no longer in the list and initializes only new ones. The rack now uses wxBitmapButton instead of Audacity's AButton. The AButton has a timing issue that prevents it from being deleted while processing the click event. I looked into it, but gave up and switched to the wxBitmapButton. Unfortunately, there's a problem with the wxBitmapButton as well...at least on my setup here. Either the bitmaps are being scaled or antialiased. Will have to get feedback on this. I finally figured out why some VSTs didn't seem to do anything in realtime, at least in my case anyway. I've installed a lot of demo VSTs and while they work in "batch/offline" mode, some of them will not work in realtime since vendors tend to remove automation as one of the demo limitations. More changes coming shortly...
2014-11-03 06:48:54 +00:00
mRealtimeLock.Leave();
//
// This is wrong...needs to handle tails
//
return numSamples;
}
//
// This will be called in a different thread than the main GUI thread.
//
void EffectManager::RealtimeProcessEnd()
{
// Protect ourselves from the main thread
mRealtimeLock.Enter();
// Can be suspended because of the audio stream being paused or because effects
// have been suspended.
if (!mRealtimeSuspended)
{
for (auto e : mRealtimeEffects)
{
if (e->IsRealtimeActive())
e->RealtimeProcessEnd();
}
}
mRealtimeLock.Leave();
}
int EffectManager::GetRealtimeLatency()
{
return mRealtimeLatency;
}
Effect *EffectManager::GetEffect(const PluginID & ID)
{
// Must have a "valid" ID
if (ID.IsEmpty())
{
return NULL;
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
// If it is actually a command then refuse it (as an effect).
if( mCommands.find( ID ) != mCommands.end() )
return NULL;
// TODO: This is temporary and should be redone when all effects are converted
if (mEffects.find(ID) == mEffects.end())
{
// This will instantiate the effect client if it hasn't already been done
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
EffectDefinitionInterface *ident = dynamic_cast<EffectDefinitionInterface *>(PluginManager::Get().GetInstance(ID));
if (ident && ident->IsLegacy())
{
auto effect = dynamic_cast<Effect *>(ident);
if (effect && effect->Startup(NULL))
{
mEffects[ID] = effect;
return effect;
}
}
auto effect = std::make_shared<Effect>(); // TODO: use make_unique and store in std::unordered_map
if (effect)
{
EffectClientInterface *client = dynamic_cast<EffectClientInterface *>(ident);
if (client && effect->Startup(client))
{
auto pEffect = effect.get();
mEffects[ID] = pEffect;
mHostEffects[ID] = std::move(effect);
return pEffect;
}
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
auto command = dynamic_cast<AudacityCommand *>(PluginManager::Get().GetInstance(ID));
if( !command )
AudacityMessageBox(wxString::Format(_("Attempting to initialize the following effect failed:\n\n%s\n\nMore information may be available in Help->Show Log"),
2018-03-08 18:31:42 +00:00
GetCommandName(ID)),
_("Effect failed to initialize"));
return NULL;
}
return mEffects[ID];
}
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
AudacityCommand *EffectManager::GetAudacityCommand(const PluginID & ID)
{
// Must have a "valid" ID
if (ID.IsEmpty())
{
return NULL;
}
// TODO: This is temporary and should be redone when all effects are converted
if (mCommands.find(ID) == mCommands.end())
{
// This will instantiate the effect client if it hasn't already been done
auto command = dynamic_cast<AudacityCommand *>(PluginManager::Get().GetInstance(ID));
if (command )//&& command->Startup(NULL))
{
command->Init();
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
mCommands[ID] = command;
return command;
}
/*
if (ident && ident->IsLegacy())
{
auto command = dynamic_cast<AudacityCommand *>(ident);
if (commandt && command->Startup(NULL))
{
mCommands[ID] = command;
return command;
}
}
auto command = std::make_shared<AudacityCommand>(); // TODO: use make_unique and store in std::unordered_map
if (command)
{
AudacityCommand *client = dynamic_cast<AudacityCommand *>(ident);
if (client && command->Startup(client))
{
auto pCommand = command.get();
mEffects[ID] = pCommand;
mHostEffects[ID] = std::move(effect);
return pEffect;
}
}
*/
AudacityMessageBox(wxString::Format(_("Attempting to initialize the following command failed:\n\n%s\n\nMore information may be available in Help->Show Log"),
2018-03-08 18:31:42 +00:00
GetCommandName(ID)),
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
_("Command failed to initialize"));
return NULL;
}
return mCommands[ID];
}
const PluginID & EffectManager::GetEffectByIdentifier(const wxString & strTarget)
{
static PluginID empty;
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
if (strTarget == wxEmptyString) // set GetCommandIdentifier to wxT("") to not show an effect in Batch mode
{
return empty;
}
PluginManager & pm = PluginManager::Get();
Automation: AudacityCommand This is a squash of 50 commits. This merges the capabilities of BatchCommands and Effects using a new AudacityCommand class. AudacityCommand provides one function to specify the parameters, and then we leverage that one function in automation, whether by chains, mod-script-pipe or (future) Nyquist. - Now have AudacityCommand which is using the same mechanism as Effect - Has configurable parameters - Has data-entry GUI (built using shuttle GUI) - Registers with PluginManager. - Menu commands now provided in chains, and to python batch. - Tested with Zoom Toggle. - ShuttleParams now can set, get, set defaults, validate and specify the parameters. - Bugfix: Don't overwrite values with defaults first time out. - Add DefineParams function for all built-in effects. - Extend CommandContext to carry output channels for results. We abuse EffectsManager. It handles both Effects and AudacityCommands now. In time an Effect should become a special case of AudacityCommand and we'll split and rename the EffectManager class. - Don't use 'default' as a parameter name. - Massive renaming for CommandDefinitionInterface - EffectIdentInterface becomes EffectDefinitionInterface - EffectAutomationParameters becomes CommandAutomationParameters - PluginType is now a bit field. This way we can search for related types at the same time. - Most old batch commands made into AudacityCommands. The ones that weren't are for a reason. They are used by mod-script-pipe to carry commands and responses across from a non-GUI thread to the GUI thread. - Major tidy up of ScreenshotCommand - Reworking of SelectCommand - GetPreferenceCommand and SetPreferenceCommand - GetTrackInfo and SetTrackInfo - GetInfoCommand - Help, Open, Save, Import and Export commands. - Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo which are now better handled by other commands. - JSONify "GetInfo: Commands" output, i.e. commas in the right places. - General work on better Doxygen. - Lyrics -> LyricsPanel - Meter -> MeterPanel - Updated Linux makefile. - Scripting commands added into Extra menu. - Distinct names for previously duplicated find-clipping parameters. - Fixed longstanding error with erroneous status field number which previously caused an ASSERT in debug. - Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
// Effects OR Generic commands...
2018-02-08 21:12:49 +00:00
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect | PluginTypeAudacityCommand);
while (plug)
{
2018-02-16 22:47:36 +00:00
if (GetCommandIdentifier(plug->GetID()).IsSameAs(strTarget, false))
{
return plug->GetID();
}
2018-02-08 21:12:49 +00:00
plug = pm.GetNextPlugin(PluginTypeEffect | PluginTypeAudacityCommand);
}
return empty;;
}