1#include "../Benchmark.h"
2#include "../CommonCommandFlags.h"
3#include "../MenuCreator.h"
4#include "../PluginRegistrationDialog.h"
5#include "../ProjectWindows.h"
6#include "../commands/CommandDispatch.h"
7#include "../effects/EffectUI.h"
8#include "../prefs/PrefsDialog.h"
9#include "../toolbars/SelectionBar.h"
10#include "../toolbars/ToolManager.h"
42 return dlg.ShowModal() == wxID_OK;
59 else if (
auto pTrack =
dynamic_cast<SampleTrack *
>(trackFocus.Get()))
60 panel.ShowPanel(pTrack,
true);
76 commandManager.mLastGenerator =
"";
77 commandManager.mLastEffect =
"";
78 commandManager.mLastAnalyzer =
"";
79 commandManager.mLastTool =
"";
157 auto lastEffect = commandManager.mLastGenerator;
158 if (!lastEffect.empty())
167 auto lastEffect = commandManager.mLastEffect;
168 if (!lastEffect.empty())
175 switch (commandManager.mLastAnalyzerRegistration) {
178 auto lastEffect = commandManager.mLastAnalyzer;
179 if (!lastEffect.empty())
181 lastEffect, context.
project, commandManager.mRepeatAnalyzerFlags);
186 commandManager.mLastAnalyzerRegisteredId);
217 bool &setting = gAudioIO->mSimulateRecordingErrors;
218 commandManager.Check(
wxT(
"SimulateRecordingErrors"), !setting);
228 auto &setting = gAudioIO->mDetectUpstreamDropouts;
229 auto oldValue = setting.load(std::memory_order_relaxed);
230 commandManager.Check(
wxT(
"DetectUpstreamDropouts"), !oldValue);
231 setting.store(!oldValue, std::memory_order_relaxed);
239 XO(
"A journal will be recorded after Audacity restarts.");
243 XO(
"No journal will be recorded after Audacity restarts.");
274 static auto menu = std::shared_ptr{
285 const auto &lastGenerator =
288 if (!lastGenerator.empty())
293 buildMenuLabel =
XO(
"Repeat Last Generator");
295 return Command(
wxT(
"RepeatLastGenerator"), buildMenuLabel,
306 auto result =
Items(
"");
341 return (trackFocus.Get() !=
nullptr);
351 static auto menu = std::shared_ptr {
Menu(
352 wxT(
"Effect"),
XXO(
"Effe&ct"),
355 wxT(
"ManageEffects"),
XXO(
"Plugin Manager"),
361 wxT(
"AddRealtimeEffects"),
XXO(
"Add Realtime Effects"),
363#
if defined(__WXMSW__) || defined(__WXMAC__)
365 wxT(
"GetMoreEffects"),
XXO(
"Get more effects..."),
371#
if defined(__WXMSW__)
373 wxT(
"GetAIEffects"),
XXO(
"Get AI effects..."),
386 if (!lastEffect.empty())
391 buildMenuLabel =
XO(
"Repeat Last Effect");
393 return Command(
wxT(
"RepeatLastEffect"), buildMenuLabel,
404 auto result =
Items(
"");
434 static auto menu = std::shared_ptr{
445 const auto &lastAnalyzer =
448 if (!lastAnalyzer.empty())
453 buildMenuLabel =
XO(
"Repeat Last Analyzer");
455 return Command(
wxT(
"RepeatLastAnalyzer"), buildMenuLabel,
468 auto result =
Items(
"");
486 static auto menu = std::shared_ptr{
513 auto result =
Items(
"");
528 XXO(
"Simulate Recording Errors"),
535 XXO(
"Detect Upstream Dropouts"),
541 .load(std::memory_order_relaxed); } ) )
545#
if defined(IS_ALPHA) || defined(END_USER_JOURNALLING)
551 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")
BoolSetting & ShowRMSPref()
BoolSetting & ShowClippingPref()
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
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
bool OpenInDefaultBrowser(const wxString &url)
Open an URL in default browser.
bool DoEffect(const PluginID &ID, AudacityProject &project, unsigned flags)
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()