2#include "../Benchmark.h"
3#include "../commands/CommandDispatch.h"
4#include "../CommonCommandFlags.h"
6#include "../MenuCreator.h"
8#include "../PluginRegistrationDialog.h"
13#include "../ProjectWindows.h"
17#include "../toolbars/ToolManager.h"
18#include "../toolbars/SelectionBar.h"
25#include "../effects/EffectManager.h"
26#include "../effects/EffectUI.h"
28#include "../prefs/PrefsDialog.h"
40 return dlg.ShowModal() == wxID_OK;
57 else if (
auto pTrack =
dynamic_cast<SampleTrack *
>(trackFocus.Get()))
58 panel.ShowPanel(pTrack,
true);
74 commandManager.mLastGenerator =
"";
75 commandManager.mLastEffect =
"";
76 commandManager.mLastAnalyzer =
"";
77 commandManager.mLastTool =
"";
150 auto lastEffect = commandManager.mLastGenerator;
151 if (!lastEffect.empty())
161 auto lastEffect = commandManager.mLastEffect;
162 if (!lastEffect.empty())
165 lastEffect, context, commandManager.mRepeatEffectFlags);
172 switch (commandManager.mLastAnalyzerRegistration) {
175 auto lastEffect = commandManager.mLastAnalyzer;
176 if (!lastEffect.empty())
179 lastEffect, context, commandManager.mRepeatAnalyzerFlags);
185 commandManager.mLastAnalyzerRegisteredId);
216 bool &setting = gAudioIO->mSimulateRecordingErrors;
217 commandManager.Check(
wxT(
"SimulateRecordingErrors"), !setting);
227 auto &setting = gAudioIO->mDetectUpstreamDropouts;
228 auto oldValue = setting.load(std::memory_order_relaxed);
229 commandManager.Check(
wxT(
"DetectUpstreamDropouts"), !oldValue);
230 setting.store(!oldValue, std::memory_order_relaxed);
238 XO(
"A journal will be recorded after Audacity restarts.");
242 XO(
"No journal will be recorded after Audacity restarts.");
273 static auto menu = std::shared_ptr{
284 const auto &lastGenerator =
287 if (!lastGenerator.empty())
288 buildMenuLabel =
XO(
"Repeat %s")
291 buildMenuLabel =
XO(
"Repeat Last Generator");
293 return Command(
wxT(
"RepeatLastGenerator"), buildMenuLabel,
304 auto result =
Items(
"");
339 return (trackFocus.Get() !=
nullptr);
349 static auto menu = std::shared_ptr{
357 Command (
wxT(
"AddRealtimeEffects"),
XXO(
"Add Realtime Effects"),
367 if (!lastEffect.empty())
368 buildMenuLabel =
XO(
"Repeat %s")
371 buildMenuLabel =
XO(
"Repeat Last Effect");
373 return Command(
wxT(
"RepeatLastEffect"), buildMenuLabel,
384 auto result =
Items(
"");
415 static auto menu = std::shared_ptr{
426 const auto &lastAnalyzer =
429 if (!lastAnalyzer.empty())
430 buildMenuLabel =
XO(
"Repeat %s")
433 buildMenuLabel =
XO(
"Repeat Last Analyzer");
435 return Command(
wxT(
"RepeatLastAnalyzer"), buildMenuLabel,
448 auto result =
Items(
"");
466 static auto menu = std::shared_ptr{
493 auto result =
Items(
"");
508 XXO(
"Simulate Recording Errors"),
515 XXO(
"Detect Upstream Dropouts"),
521 .load(std::memory_order_relaxed); } ) )
525#
if defined(IS_ALPHA) || defined(END_USER_JOURNALLING)
531 XXO(
"Write Journal"),
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
BoolSetting SoundActivatedRecord
AttachedItem sAttachment1
AttachedItem sAttachment3
AttachedItem sAttachment2
void RunBenchmark(wxWindow *parent, AudacityProject &project)
constexpr CommandFlag AlwaysEnabledFlag
const ReservedCommandFlag & AudioIONotBusyFlag()
const ReservedCommandFlag & TimeSelectedFlag()
const ReservedCommandFlag & WaveTracksSelectedFlag()
ChoiceSetting EffectsGroupBy
XXO("&Cut/Copy/Paste Toolbar")
audacity::BasicSettings * gPrefs
void ResetPreferences()
Call this to reset preferences to an (almost)-"new" default state.
#define AUDACITY_PREFS_VERSION_STRING
void DoReloadPreferences(AudacityProject &project)
an object holding per-project preferred sample rate
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
IntSetting SelectionToolbarMode
StringSetting SnapToSetting
EnumSetting< SnapMode > SnapModeSetting
BoolSetting SyncLockTracks
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
bool mSimulateRecordingErrors
std::atomic< bool > mDetectUpstreamDropouts
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
CommandParameter parameter
AudacityProject & project
void RegisterLastTool(const CommandContext &context)
void DoRepeatProcess(const CommandContext &context, int)
static CommandManager & Get(AudacityProject &project)
int mLastAnalyzerRegistration
static EffectManager & Get()
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
static PluginManager & Get()
static ProjectRate & Get(AudacityProject &project)
void SetRate(double rate)
void SetSnapMode(SnapMode mode)
void SetSnapTo(Identifier snap)
static ProjectSnap & Get(AudacityProject &project)
static RealtimeEffectManager & Get(AudacityProject &project)
bool IsActive() const noexcept
To be called only from main thread.
static RealtimeEffectPanel & Get(AudacityProject &project)
Generates classes whose instances register items at construction.
bool Reset()
Reset to the default value.
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined */
Holds a msgid for the translation catalog; may also bind format arguments.
void SetToDefaultSize()
Send a message to the main window PARENT of the viewport, to resize.
static Viewport & Get(AudacityProject &project)
virtual bool Flush() noexcept=0
double ReadDouble(const wxString &key, double defaultValue) const
virtual bool Write(const wxString &key, bool value)=0
AUDACITY_DLL_API bool DoEffect(const PluginID &ID, const CommandContext &context, unsigned flags)
'Repeat Last Effect'.
FILES_API void UpdateDefaultPath(Operation op, const FilePath &path)
Facilities for recording and playback of sequences of user interaction.
bool SetRecordEnabled(bool value)
std::unique_ptr< detail::IndirectItem< Item > > Indirect(const std::shared_ptr< Item > &ptr)
A convenience function.
FILES_API const FilePath & DefaultTempDir()