mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
Fix for bug #981
This commit is contained in:
parent
ca7c107fdc
commit
b8ce7f6125
13
lib-src/mod-nyq-bench/NyqBench.cpp
Normal file → Executable file
13
lib-src/mod-nyq-bench/NyqBench.cpp
Normal file → Executable file
@ -689,10 +689,6 @@ NyqBench::NyqBench(wxWindow * parent)
|
|||||||
mScript = NULL;
|
mScript = NULL;
|
||||||
mOutput = NULL;
|
mOutput = NULL;
|
||||||
|
|
||||||
// No need to delete...EffectManager will do it
|
|
||||||
mEffect = new NyquistEffect(wxT("===nyquistworker==="));
|
|
||||||
EffectManager::Get().RegisterEffect(mEffect);
|
|
||||||
|
|
||||||
mPath = gPrefs->Read(wxT("NyqBench/Path"), wxEmptyString);
|
mPath = gPrefs->Read(wxT("NyqBench/Path"), wxEmptyString);
|
||||||
mAutoLoad = (gPrefs->Read(wxT("NyqBench/AutoLoad"), 0L) != 0);
|
mAutoLoad = (gPrefs->Read(wxT("NyqBench/AutoLoad"), 0L) != 0);
|
||||||
mAutoWrap = (gPrefs->Read(wxT("NyqBench/AutoWrap"), true) != 0);
|
mAutoWrap = (gPrefs->Read(wxT("NyqBench/AutoWrap"), true) != 0);
|
||||||
@ -1353,6 +1349,10 @@ void NyqBench::OnLargeIcons(wxCommandEvent & e)
|
|||||||
|
|
||||||
void NyqBench::OnGo(wxCommandEvent & e)
|
void NyqBench::OnGo(wxCommandEvent & e)
|
||||||
{
|
{
|
||||||
|
// No need to delete...EffectManager will do it
|
||||||
|
mEffect = new NyquistEffect(wxT("Nyquist Effect Workbench"));
|
||||||
|
const PluginID & ID = EffectManager::Get().RegisterEffect(mEffect);
|
||||||
|
|
||||||
mEffect->SetCommand(mScript->GetValue());
|
mEffect->SetCommand(mScript->GetValue());
|
||||||
mEffect->RedirectOutput();
|
mEffect->RedirectOutput();
|
||||||
|
|
||||||
@ -1366,14 +1366,15 @@ void NyqBench::OnGo(wxCommandEvent & e)
|
|||||||
mRunning = true;
|
mRunning = true;
|
||||||
UpdateWindowUI();
|
UpdateWindowUI();
|
||||||
|
|
||||||
const PluginID & id = EffectManager::Get().GetEffectByIdentifier(mEffect->GetSymbol());
|
p->OnEffect(ID);
|
||||||
p->OnEffect(id);
|
|
||||||
|
|
||||||
mRunning = false;
|
mRunning = false;
|
||||||
UpdateWindowUI();
|
UpdateWindowUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
Raise();
|
Raise();
|
||||||
|
|
||||||
|
EffectManager::Get().UnregisterEffect(ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NyqBench::OnStop(wxCommandEvent & e)
|
void NyqBench::OnStop(wxCommandEvent & e)
|
||||||
|
0
lib-src/mod-nyq-bench/NyqBench.h
Normal file → Executable file
0
lib-src/mod-nyq-bench/NyqBench.h
Normal file → Executable file
@ -66,7 +66,7 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>audacity.lib;wxbase28ud.lib;wxbase28ud_net.lib;wxmsw28ud_adv.lib;wxmsw28ud_core.lib;wxmsw28ud_html.lib;wxpngd.lib;wxzlibd.lib;wxjpegd.lib;wxtiffd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>audacity.lib;wxbase28ud.lib;wxbase28ud_net.lib;wxmsw28ud_adv.lib;wxmsw28ud_core.lib;wxmsw28ud_html.lib;wxpngd.lib;wxzlibd.lib;wxjpegd.lib;wxtiffd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<OutputFile>$(OutDir)modules\$(ProjectName).dll</OutputFile>
|
<OutputFile>..\..\win\$(ConfigurationName)\modules\$(ProjectName).dll</OutputFile>
|
||||||
<AdditionalLibraryDirectories>..\..\win/$(Configuration);$(WXWIN)\lib\vc_dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>..\..\win/$(Configuration);$(WXWIN)\lib\vc_dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@ -91,7 +91,7 @@ copy "$(TargetPath)" "%25dest%25"
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>audacity.lib;wxbase28u.lib;wxbase28u_net.lib;wxmsw28u_adv.lib;wxmsw28u_core.lib;wxmsw28u_html.lib;wxpng.lib;wxzlib.lib;wxjpeg.lib;wxtiff.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>audacity.lib;wxbase28u.lib;wxbase28u_net.lib;wxmsw28u_adv.lib;wxmsw28u_core.lib;wxmsw28u_html.lib;wxpng.lib;wxzlib.lib;wxjpeg.lib;wxtiff.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<OutputFile>$(OutDir)modules\$(ProjectName).dll</OutputFile>
|
<OutputFile>..\..\win\$(ConfigurationName)\modules\$(ProjectName).dll</OutputFile>
|
||||||
<AdditionalLibraryDirectories>../../win/$(Configuration);$(WXWIN)\lib\vc_dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>../../win/$(Configuration);$(WXWIN)\lib\vc_dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
@ -2201,6 +2201,18 @@ const PluginID & PluginManager::RegisterPlugin(EffectIdentInterface *effect)
|
|||||||
return plug.GetID();
|
return plug.GetID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Here solely for the purpose of Nyquist Workbench until
|
||||||
|
// a better solution is devised.
|
||||||
|
void PluginManager::UnregisterPlugin(const PluginID & ID)
|
||||||
|
{
|
||||||
|
if (mPlugins.find(ID) == mPlugins.end())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mPlugins.erase(ID);
|
||||||
|
}
|
||||||
|
|
||||||
int PluginManager::GetPluginCount(PluginType type)
|
int PluginManager::GetPluginCount(PluginType type)
|
||||||
{
|
{
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
@ -262,6 +262,7 @@ public:
|
|||||||
// Here solely for the purpose of Nyquist Workbench until
|
// Here solely for the purpose of Nyquist Workbench until
|
||||||
// a better solution is devised.
|
// a better solution is devised.
|
||||||
const PluginID & RegisterPlugin(EffectIdentInterface *effect);
|
const PluginID & RegisterPlugin(EffectIdentInterface *effect);
|
||||||
|
void UnregisterPlugin(const PluginID & ID);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Load();
|
void Load();
|
||||||
|
18
src/effects/EffectManager.cpp
Normal file → Executable file
18
src/effects/EffectManager.cpp
Normal file → Executable file
@ -65,10 +65,22 @@ EffectManager::~EffectManager()
|
|||||||
|
|
||||||
// Here solely for the purpose of Nyquist Workbench until
|
// Here solely for the purpose of Nyquist Workbench until
|
||||||
// a better solution is devised.
|
// a better solution is devised.
|
||||||
void EffectManager::RegisterEffect(Effect *f)
|
const PluginID & EffectManager::RegisterEffect(Effect *f)
|
||||||
{
|
{
|
||||||
// This will go away after all effects have been converted
|
const PluginID & ID = PluginManager::Get().RegisterPlugin(f);
|
||||||
mEffects[PluginManager::Get().RegisterPlugin(f)] = f;
|
|
||||||
|
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,
|
bool EffectManager::DoEffect(const PluginID & ID,
|
||||||
|
5
src/effects/EffectManager.h
Normal file → Executable file
5
src/effects/EffectManager.h
Normal file → Executable file
@ -56,10 +56,11 @@ public:
|
|||||||
EffectManager();
|
EffectManager();
|
||||||
virtual ~EffectManager();
|
virtual ~EffectManager();
|
||||||
|
|
||||||
/** Register an effect so it can be executed. */
|
/** (Un)Register an effect so it can be executed. */
|
||||||
// Here solely for the purpose of Nyquist Workbench until
|
// Here solely for the purpose of Nyquist Workbench until
|
||||||
// a better solution is devised.
|
// a better solution is devised.
|
||||||
void RegisterEffect(Effect *f);
|
const PluginID & RegisterEffect(Effect *f);
|
||||||
|
void UnregisterEffect(const PluginID & ID);
|
||||||
|
|
||||||
/** Run an effect given the plugin ID */
|
/** Run an effect given the plugin ID */
|
||||||
// Returns true on success. Will only operate on tracks that
|
// Returns true on success. Will only operate on tracks that
|
||||||
|
11
src/effects/nyquist/Nyquist.cpp
Normal file → Executable file
11
src/effects/nyquist/Nyquist.cpp
Normal file → Executable file
@ -150,11 +150,6 @@ NyquistEffect::~NyquistEffect()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void NyquistEffect::RedirectOutput()
|
|
||||||
{
|
|
||||||
wxFAIL_MSG(XO("JKC: This function used to exist. Have a look in SVN and see if you can find it") );
|
|
||||||
}
|
|
||||||
|
|
||||||
// IdentInterface implementation
|
// IdentInterface implementation
|
||||||
|
|
||||||
wxString NyquistEffect::GetPath()
|
wxString NyquistEffect::GetPath()
|
||||||
@ -1180,6 +1175,12 @@ wxArrayString NyquistEffect::ParseChoice(const NyqControl & ctrl)
|
|||||||
|
|
||||||
return choices;
|
return choices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NyquistEffect::RedirectOutput()
|
||||||
|
{
|
||||||
|
mRedirectOutput = true;
|
||||||
|
}
|
||||||
|
|
||||||
void NyquistEffect::SetCommand(wxString cmd)
|
void NyquistEffect::SetCommand(wxString cmd)
|
||||||
{
|
{
|
||||||
mExternal = true;
|
mExternal = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user