mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-31 07:59:27 +02:00
Plugin Menus
This commit is contained in:
parent
1be1217d1d
commit
9759c6bd4f
@ -1403,7 +1403,7 @@ void NyqBench::OnGo(wxCommandEvent & e)
|
||||
mRunning = true;
|
||||
UpdateWindowUI();
|
||||
|
||||
GetMenuCommandHandler(*p).DoEffect(ID, CommandContext(*p), 0);
|
||||
PluginActions::DoEffect(ID, CommandContext(*p), 0);
|
||||
|
||||
mRunning = false;
|
||||
UpdateWindowUI();
|
||||
|
@ -720,14 +720,14 @@ bool MacroCommands::ApplyEffectCommand(
|
||||
{
|
||||
if( plug->GetPluginType() == PluginTypeAudacityCommand )
|
||||
// and apply the effect...
|
||||
res = GetMenuCommandHandler(*project).DoAudacityCommand(ID,
|
||||
res = PluginActions::DoAudacityCommand(ID,
|
||||
Context,
|
||||
MenuCommandHandler::OnEffectFlags::kConfigured |
|
||||
MenuCommandHandler::OnEffectFlags::kSkipState |
|
||||
MenuCommandHandler::OnEffectFlags::kDontRepeatLast);
|
||||
else
|
||||
// and apply the effect...
|
||||
res = GetMenuCommandHandler(*project).DoEffect(ID,
|
||||
res = PluginActions::DoEffect(ID,
|
||||
Context,
|
||||
MenuCommandHandler::OnEffectFlags::kConfigured |
|
||||
MenuCommandHandler::OnEffectFlags::kSkipState |
|
||||
|
1052
src/Menus.cpp
1052
src/Menus.cpp
File diff suppressed because it is too large
Load Diff
27
src/Menus.h
27
src/Menus.h
@ -97,9 +97,6 @@ void OnCheckDependencies(const CommandContext &context );
|
||||
|
||||
public:
|
||||
|
||||
void OnPlotSpectrum(const CommandContext &context );
|
||||
void OnContrast(const CommandContext &context );
|
||||
|
||||
// Effect Menu
|
||||
|
||||
struct OnEffectFlags
|
||||
@ -115,20 +112,7 @@ struct OnEffectFlags
|
||||
static const int kDontRepeatLast = 0x04;
|
||||
};
|
||||
|
||||
bool DoEffect(const PluginID & ID, const CommandContext & context, int flags);
|
||||
void OnEffect(const CommandContext &context );
|
||||
void OnRepeatLastEffect(const CommandContext &context );
|
||||
bool DoAudacityCommand(const PluginID & ID, const CommandContext &, int flags);
|
||||
void OnApplyMacroDirectly(const CommandContext &context );
|
||||
void OnApplyMacrosPalette(const CommandContext &context );
|
||||
void OnManageMacros(const CommandContext &context );
|
||||
void OnAudacityCommand(const CommandContext &context );
|
||||
void DoManagePluginsMenu(AudacityProject &project, EffectType Type);
|
||||
static void RebuildAllMenuBars();
|
||||
void OnManageGenerators(const CommandContext &context );
|
||||
void OnManageEffects(const CommandContext &context );
|
||||
void OnManageAnalyzers(const CommandContext &context );
|
||||
void OnManageTools(const CommandContext &context );
|
||||
|
||||
// Help Menu
|
||||
|
||||
@ -140,13 +124,9 @@ void OnCheckForUpdates(const CommandContext &context );
|
||||
void MayCheckForUpdates(AudacityProject &project);
|
||||
void OnShowLog(const CommandContext &context );
|
||||
void OnHelpWelcome(const CommandContext &context );
|
||||
void OnBenchmark(const CommandContext &context );
|
||||
#if defined(EXPERIMENTAL_CRASH_REPORT)
|
||||
void OnCrashReport(const CommandContext &context );
|
||||
#endif
|
||||
void OnSimulateRecordingErrors(const CommandContext &context );
|
||||
void OnDetectUpstreamDropouts(const CommandContext &context );
|
||||
void OnScreenshot(const CommandContext &context );
|
||||
void OnAudioDeviceInfo(const CommandContext &context );
|
||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||
void OnMidiDeviceInfo(const CommandContext &context );
|
||||
@ -267,6 +247,13 @@ void DoMoveTrack( AudacityProject &project, Track* target, MoveChoice choice );
|
||||
void DoRemoveTracks( AudacityProject & );
|
||||
}
|
||||
|
||||
namespace PluginActions {
|
||||
bool DoEffect(
|
||||
const PluginID & ID, const CommandContext & context, unsigned flags );
|
||||
bool DoAudacityCommand(
|
||||
const PluginID & ID, const CommandContext & context, unsigned flags );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -4416,8 +4416,8 @@ bool AudacityProject::Import(const wxString &fileName, WaveTrackArray* pTrackArr
|
||||
SelectNone();
|
||||
SelectAllIfNone();
|
||||
const CommandContext context( *this);
|
||||
GetMenuCommandHandler(*this)
|
||||
.DoEffect(EffectManager::Get().GetEffectByIdentifier(wxT("Normalize")),
|
||||
PluginActions::DoEffect(
|
||||
EffectManager::Get().GetEffectByIdentifier(wxT("Normalize")),
|
||||
context,
|
||||
MenuCommandHandler::OnEffectFlags::kConfigured);
|
||||
}
|
||||
|
@ -1587,7 +1587,9 @@ bool CommandManager::HandleTextualCommand(const wxString & Str, const CommandCon
|
||||
{
|
||||
if (em.GetCommandIdentifier(plug->GetID()).IsSameAs(Str, false))
|
||||
{
|
||||
return GetMenuCommandHandler(*proj).DoEffect(plug->GetID(), context, MenuCommandHandler::OnEffectFlags::kConfigured);
|
||||
return PluginActions::DoEffect(
|
||||
plug->GetID(), context,
|
||||
MenuCommandHandler::OnEffectFlags::kConfigured);
|
||||
}
|
||||
plug = pm.GetNextPlugin(PluginTypeEffect);
|
||||
}
|
||||
|
@ -768,7 +768,7 @@ bool Effect::Apply()
|
||||
// This is absolute hackage...but easy and I can't think of another way just now.
|
||||
//
|
||||
// It should callback to the EffectManager to kick off the processing
|
||||
return GetMenuCommandHandler(project).DoEffect(GetID(), context,
|
||||
return PluginActions::DoEffect(GetID(), context,
|
||||
MenuCommandHandler::OnEffectFlags::kConfigured);
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,7 @@ void EffectRack::OnApply(wxCommandEvent & WXUNUSED(evt))
|
||||
{
|
||||
if (mPowerState[i])
|
||||
{
|
||||
if (!GetMenuCommandHandler(*project).DoEffect(mEffects[i]->GetID(),
|
||||
if (!PluginActions::DoEffect(mEffects[i]->GetID(),
|
||||
*project,
|
||||
AudacityProject::OnEffectFlags::kConfigured))
|
||||
// If any effect fails (or throws), then stop.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -635,8 +635,8 @@ void OnNewTimeTrack(const CommandContext &context)
|
||||
|
||||
void OnStereoToMono(const CommandContext &context)
|
||||
{
|
||||
GetMenuCommandHandler(context.project).
|
||||
DoEffect(EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono")),
|
||||
PluginActions::DoEffect(
|
||||
EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono")),
|
||||
context,
|
||||
MenuCommandHandler::OnEffectFlags::kConfigured);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user