mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-24 16:20:05 +02:00
Bug 2343 - Presets: Effect Ids not the same in Presets as for Macros
This commit is contained in:
parent
301c511422
commit
95bbe617b8
@ -35,6 +35,7 @@
|
|||||||
#include "../Shuttle.h"
|
#include "../Shuttle.h"
|
||||||
#include "../ViewInfo.h"
|
#include "../ViewInfo.h"
|
||||||
#include "../WaveTrack.h"
|
#include "../WaveTrack.h"
|
||||||
|
#include "../Effects/EffectManager.h"
|
||||||
#include "../wxFileNameWrapper.h"
|
#include "../wxFileNameWrapper.h"
|
||||||
#include "../widgets/ProgressDialog.h"
|
#include "../widgets/ProgressDialog.h"
|
||||||
#include "../ondemand/ODManager.h"
|
#include "../ondemand/ODManager.h"
|
||||||
@ -666,7 +667,9 @@ void Effect::ExportPresets()
|
|||||||
{
|
{
|
||||||
wxString params;
|
wxString params;
|
||||||
GetAutomationParameters(params);
|
GetAutomationParameters(params);
|
||||||
params = GetSymbol().Internal() + ":" + params;
|
EffectManager & em = EffectManager::Get();
|
||||||
|
wxString commandId = em.GetSquashedName(GetSymbol().Internal()).GET();
|
||||||
|
params = commandId + ":" + params;
|
||||||
|
|
||||||
auto path = FileNames::DefaultToDocumentsFolder(wxT("Presets/Path"));
|
auto path = FileNames::DefaultToDocumentsFolder(wxT("Presets/Path"));
|
||||||
|
|
||||||
@ -741,7 +744,11 @@ void Effect::ImportPresets()
|
|||||||
if (f.ReadAll(¶ms)) {
|
if (f.ReadAll(¶ms)) {
|
||||||
wxString ident = params.BeforeFirst(':');
|
wxString ident = params.BeforeFirst(':');
|
||||||
params = params.AfterFirst(':');
|
params = params.AfterFirst(':');
|
||||||
if (ident != GetSymbol().Internal()) {
|
|
||||||
|
EffectManager & em = EffectManager::Get();
|
||||||
|
wxString commandId = em.GetSquashedName(GetSymbol().Internal()).GET();
|
||||||
|
|
||||||
|
if (ident != commandId) {
|
||||||
// effect identifiers are a sensible length!
|
// effect identifiers are a sensible length!
|
||||||
// must also have some params.
|
// must also have some params.
|
||||||
if ((params.Length() < 2 ) || (ident.Length() < 2) || (ident.Length() > 30))
|
if ((params.Length() < 2 ) || (ident.Length() < 2) || (ident.Length() > 30))
|
||||||
|
@ -122,7 +122,11 @@ TranslatableString EffectManager::GetVendorName(const PluginID & ID)
|
|||||||
CommandID EffectManager::GetCommandIdentifier(const PluginID & ID)
|
CommandID EffectManager::GetCommandIdentifier(const PluginID & ID)
|
||||||
{
|
{
|
||||||
wxString name = PluginManager::Get().GetSymbol(ID).Internal();
|
wxString name = PluginManager::Get().GetSymbol(ID).Internal();
|
||||||
|
return GetSquashedName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
CommandID EffectManager::GetSquashedName(wxString name)
|
||||||
|
{
|
||||||
// Get rid of leading and trailing white space
|
// Get rid of leading and trailing white space
|
||||||
name.Trim(true).Trim(false);
|
name.Trim(true).Trim(false);
|
||||||
|
|
||||||
|
@ -94,6 +94,7 @@ public:
|
|||||||
ComponentInterfaceSymbol GetCommandSymbol(const PluginID & ID);
|
ComponentInterfaceSymbol GetCommandSymbol(const PluginID & ID);
|
||||||
TranslatableString GetCommandName(const PluginID & ID);
|
TranslatableString GetCommandName(const PluginID & ID);
|
||||||
CommandID GetCommandIdentifier(const PluginID & ID);
|
CommandID GetCommandIdentifier(const PluginID & ID);
|
||||||
|
CommandID GetSquashedName(wxString name);
|
||||||
TranslatableString GetCommandDescription(const PluginID & ID);
|
TranslatableString GetCommandDescription(const PluginID & ID);
|
||||||
wxString GetCommandUrl(const PluginID & ID);
|
wxString GetCommandUrl(const PluginID & ID);
|
||||||
wxString GetCommandTip(const PluginID & ID);
|
wxString GetCommandTip(const PluginID & ID);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user