mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-08 22:23:59 +01:00
Fixes StereoToMono effect
The problem is that lookup of effects is based on their ID and legacy effects didn't play well in this scheme, so I've added a workaround for now. This will go away when I get all of the effects converted. And removes some debugging.
This commit is contained in:
@@ -175,7 +175,30 @@ wxString Effect::GetName()
|
||||
return mClient->GetName();
|
||||
}
|
||||
|
||||
return GetEffectIdentifier();
|
||||
// Break up identifier into words based on caps
|
||||
//
|
||||
// EffectManager::GetEffectIdentifier() CamelCases identifiers based on
|
||||
// blank delimited words. But not all legacy effects have blank delimted
|
||||
// words and were manually CamelCased. So use that to break up the ident
|
||||
// into words
|
||||
//
|
||||
// This is only temporary and will go away when the legacy effects
|
||||
// get converted.
|
||||
//
|
||||
wxString ident = GetEffectIdentifier();
|
||||
wxString name;
|
||||
|
||||
for (size_t i = 0, cnt = ident.Len(); i < cnt; i++)
|
||||
{
|
||||
wxChar c = ident.GetChar(i);
|
||||
if (wxIsupper(c) && i != 0)
|
||||
{
|
||||
name += wxT(' ');
|
||||
}
|
||||
name += c;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
wxString Effect::GetVendor()
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "../Audacity.h"
|
||||
|
||||
#include <wx/log.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/stopwatch.h>
|
||||
#include <wx/tokenzr.h>
|
||||
@@ -730,7 +729,6 @@ const PluginID & EffectManager::GetEffectByIdentifier(const wxString & strTarget
|
||||
const PluginDescriptor *plug = pm.GetFirstPlugin(PluginTypeEffect);
|
||||
while (plug)
|
||||
{
|
||||
wxLogDebug(wxT("id %s --- %s"), plug->GetID(), strTarget);
|
||||
if (GetEffectIdentifier(plug->GetID()).IsSameAs(strTarget))
|
||||
{
|
||||
return plug->GetID();
|
||||
|
||||
@@ -40,6 +40,11 @@ public:
|
||||
virtual bool Init();
|
||||
virtual void End();
|
||||
virtual bool CheckWhetherSkipEffect();
|
||||
|
||||
virtual bool PromptUser() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual bool Process();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user