mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 08:29: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;
|
mRunning = true;
|
||||||
UpdateWindowUI();
|
UpdateWindowUI();
|
||||||
|
|
||||||
GetMenuCommandHandler(*p).DoEffect(ID, CommandContext(*p), 0);
|
PluginActions::DoEffect(ID, CommandContext(*p), 0);
|
||||||
|
|
||||||
mRunning = false;
|
mRunning = false;
|
||||||
UpdateWindowUI();
|
UpdateWindowUI();
|
||||||
|
@ -720,14 +720,14 @@ bool MacroCommands::ApplyEffectCommand(
|
|||||||
{
|
{
|
||||||
if( plug->GetPluginType() == PluginTypeAudacityCommand )
|
if( plug->GetPluginType() == PluginTypeAudacityCommand )
|
||||||
// and apply the effect...
|
// and apply the effect...
|
||||||
res = GetMenuCommandHandler(*project).DoAudacityCommand(ID,
|
res = PluginActions::DoAudacityCommand(ID,
|
||||||
Context,
|
Context,
|
||||||
MenuCommandHandler::OnEffectFlags::kConfigured |
|
MenuCommandHandler::OnEffectFlags::kConfigured |
|
||||||
MenuCommandHandler::OnEffectFlags::kSkipState |
|
MenuCommandHandler::OnEffectFlags::kSkipState |
|
||||||
MenuCommandHandler::OnEffectFlags::kDontRepeatLast);
|
MenuCommandHandler::OnEffectFlags::kDontRepeatLast);
|
||||||
else
|
else
|
||||||
// and apply the effect...
|
// and apply the effect...
|
||||||
res = GetMenuCommandHandler(*project).DoEffect(ID,
|
res = PluginActions::DoEffect(ID,
|
||||||
Context,
|
Context,
|
||||||
MenuCommandHandler::OnEffectFlags::kConfigured |
|
MenuCommandHandler::OnEffectFlags::kConfigured |
|
||||||
MenuCommandHandler::OnEffectFlags::kSkipState |
|
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:
|
public:
|
||||||
|
|
||||||
void OnPlotSpectrum(const CommandContext &context );
|
|
||||||
void OnContrast(const CommandContext &context );
|
|
||||||
|
|
||||||
// Effect Menu
|
// Effect Menu
|
||||||
|
|
||||||
struct OnEffectFlags
|
struct OnEffectFlags
|
||||||
@ -115,20 +112,7 @@ struct OnEffectFlags
|
|||||||
static const int kDontRepeatLast = 0x04;
|
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();
|
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
|
// Help Menu
|
||||||
|
|
||||||
@ -140,13 +124,9 @@ void OnCheckForUpdates(const CommandContext &context );
|
|||||||
void MayCheckForUpdates(AudacityProject &project);
|
void MayCheckForUpdates(AudacityProject &project);
|
||||||
void OnShowLog(const CommandContext &context );
|
void OnShowLog(const CommandContext &context );
|
||||||
void OnHelpWelcome(const CommandContext &context );
|
void OnHelpWelcome(const CommandContext &context );
|
||||||
void OnBenchmark(const CommandContext &context );
|
|
||||||
#if defined(EXPERIMENTAL_CRASH_REPORT)
|
#if defined(EXPERIMENTAL_CRASH_REPORT)
|
||||||
void OnCrashReport(const CommandContext &context );
|
void OnCrashReport(const CommandContext &context );
|
||||||
#endif
|
#endif
|
||||||
void OnSimulateRecordingErrors(const CommandContext &context );
|
|
||||||
void OnDetectUpstreamDropouts(const CommandContext &context );
|
|
||||||
void OnScreenshot(const CommandContext &context );
|
|
||||||
void OnAudioDeviceInfo(const CommandContext &context );
|
void OnAudioDeviceInfo(const CommandContext &context );
|
||||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||||
void OnMidiDeviceInfo(const CommandContext &context );
|
void OnMidiDeviceInfo(const CommandContext &context );
|
||||||
@ -267,6 +247,13 @@ void DoMoveTrack( AudacityProject &project, Track* target, MoveChoice choice );
|
|||||||
void DoRemoveTracks( AudacityProject & );
|
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
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -4416,8 +4416,8 @@ bool AudacityProject::Import(const wxString &fileName, WaveTrackArray* pTrackArr
|
|||||||
SelectNone();
|
SelectNone();
|
||||||
SelectAllIfNone();
|
SelectAllIfNone();
|
||||||
const CommandContext context( *this);
|
const CommandContext context( *this);
|
||||||
GetMenuCommandHandler(*this)
|
PluginActions::DoEffect(
|
||||||
.DoEffect(EffectManager::Get().GetEffectByIdentifier(wxT("Normalize")),
|
EffectManager::Get().GetEffectByIdentifier(wxT("Normalize")),
|
||||||
context,
|
context,
|
||||||
MenuCommandHandler::OnEffectFlags::kConfigured);
|
MenuCommandHandler::OnEffectFlags::kConfigured);
|
||||||
}
|
}
|
||||||
|
@ -1587,7 +1587,9 @@ bool CommandManager::HandleTextualCommand(const wxString & Str, const CommandCon
|
|||||||
{
|
{
|
||||||
if (em.GetCommandIdentifier(plug->GetID()).IsSameAs(Str, false))
|
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);
|
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.
|
// 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
|
// 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);
|
MenuCommandHandler::OnEffectFlags::kConfigured);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ void EffectRack::OnApply(wxCommandEvent & WXUNUSED(evt))
|
|||||||
{
|
{
|
||||||
if (mPowerState[i])
|
if (mPowerState[i])
|
||||||
{
|
{
|
||||||
if (!GetMenuCommandHandler(*project).DoEffect(mEffects[i]->GetID(),
|
if (!PluginActions::DoEffect(mEffects[i]->GetID(),
|
||||||
*project,
|
*project,
|
||||||
AudacityProject::OnEffectFlags::kConfigured))
|
AudacityProject::OnEffectFlags::kConfigured))
|
||||||
// If any effect fails (or throws), then stop.
|
// 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)
|
void OnStereoToMono(const CommandContext &context)
|
||||||
{
|
{
|
||||||
GetMenuCommandHandler(context.project).
|
PluginActions::DoEffect(
|
||||||
DoEffect(EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono")),
|
EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono")),
|
||||||
context,
|
context,
|
||||||
MenuCommandHandler::OnEffectFlags::kConfigured);
|
MenuCommandHandler::OnEffectFlags::kConfigured);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user