Audacity 3.2.0
|
AudacityApp is the 'main' class for Audacity. More...
#include <AudacityApp.h>
Public Member Functions | |
AudacityApp () | |
~AudacityApp () | |
bool | Initialize (int &argc, wxChar **argv) override |
bool | OSXIsGUIApplication () override |
void | CleanUp () override |
bool | OnInit () override |
bool | InitPart2 () |
int | OnRun () override |
int | OnExit (void) override |
void | OnFatalException () override |
bool | OnExceptionInMainLoop () override |
void | OnIdle (wxIdleEvent &) |
void | OnMenuAbout (wxCommandEvent &event) |
void | OnMenuNew (wxCommandEvent &event) |
void | OnMenuOpen (wxCommandEvent &event) |
void | OnMenuPreferences (wxCommandEvent &event) |
void | OnMenuExit (wxCommandEvent &event) |
void | OnQueryEndSession (wxCloseEvent &event) |
void | OnEndSession (wxCloseEvent &event) |
void | OnMRUClear (wxCommandEvent &event) |
void | OnMRUFile (wxCommandEvent &event) |
bool | MRUOpen (const FilePath &fileName) |
bool | SafeMRUOpen (const wxString &fileName) |
void | OnReceiveCommand (AppCommandEvent &event) |
void | OnKeyDown (wxKeyEvent &event) |
void | OnTimer (wxTimerEvent &event) |
void | OnServerEvent (wxSocketEvent &evt) |
void | OnSocketEvent (wxSocketEvent &evt) |
void | MacOpenFile (const wxString &fileName) override |
void | MacPrintFile (const wxString &fileName) override |
void | MacNewFile () override |
void | AssociateFileTypes () |
void | MacActivateApp () |
void | MacFinishLaunching () |
Static Public Member Functions | |
static void | OnThemeChange (struct ThemeChangeMessage) |
Private Member Functions | |
void | OnInit0 () |
void | InitCommandHandler () |
bool | InitTempDir () |
bool | CreateSingleInstanceChecker (const wxString &dir) |
std::unique_ptr< wxCmdLineParser > | ParseCommandLine () |
Private Member Functions inherited from AppEvents::ProviderBase | |
virtual | ~ProviderBase ()=default |
void | HandleAppInitialized () |
void | HandleAppIdle () |
void | HandleAppClosing () |
Private Attributes | |
Observer::Subscription | mThemeChangeSubscription |
std::unique_ptr< CommandHandler > | mCmdHandler |
std::unique_ptr< wxSingleInstanceChecker > | mChecker |
wxTimer | mTimer |
std::unique_ptr< IPCServ > | mIPCServ |
AudacityApp is the 'main' class for Audacity.
It handles initialization and termination by subclassing wxApp.
Definition at line 38 of file AudacityApp.h.
AudacityApp::AudacityApp | ( | ) |
Definition at line 1225 of file AudacityApp.cpp.
AudacityApp::~AudacityApp | ( | ) |
Definition at line 1255 of file AudacityApp.cpp.
void AudacityApp::AssociateFileTypes | ( | ) |
Definition at line 2587 of file AudacityApp.cpp.
References CommandLineArgs::argv, AudacityMessageBox(), audacity::BasicSettings::Flush(), gPrefs, IPC_APPL, IPC_TOPIC, audacity::BasicSettings::Read(), audacity::BasicSettings::Write(), wxT(), and XO().
Referenced by InitPart2().
|
override |
Definition at line 1238 of file AudacityApp.cpp.
References gConfig.
|
private |
Definition at line 1906 of file AudacityApp.cpp.
References AudacityMessageBox(), IPC_APPL, IPC_TOPIC, mChecker, mIPCServ, name, ParseCommandLine(), wxT(), and XO().
Referenced by InitPart2().
|
private |
Definition at line 1775 of file AudacityApp.cpp.
References mCmdHandler.
Referenced by InitPart2().
|
override |
Definition at line 1229 of file AudacityApp.cpp.
References CommandLineArgs::argc, CommandLineArgs::argv, anonymous_namespace{AudacityApp.cpp}::InitCrashreports(), Journal::Events::anonymous_namespace{JournalEvents.cpp}::Initialize(), and PluginHost::IsHostProcess().
bool AudacityApp::InitPart2 | ( | ) |
Definition at line 1421 of file AudacityApp.cpp.
References _, AppInitialized, AssociateFileTypes(), Journal::Begin(), BasicUI::CallAfter(), PluginManager::CheckPluginUpdates(), AudacityFileConfig::Create(), CreateSingleInstanceChecker(), FileNames::DataDir(), ModuleManager::Dispatch(), SplashDialog::DoHelpWelcome(), FindProjectFrame(), FinishPreferences(), ExportPluginRegistry::Get(), Importer::Get(), ModuleManager::Get(), PluginManager::Get(), URLSchemesRegistry::Get(), MenuCreator::Get(), ProjectSettings::Get(), GetActiveProject(), Languages::GetLocaleName(), GetNextWindowPlacement(), GetPreferencesVersion(), ProjectSettings::GetShowSplashScreen(), gInited, FileHistory::Global(), gPrefs, AppEvents::ProviderBase::HandleAppInitialized(), URLSchemesRegistry::HandleURL(), id, AudioIO::Init(), InitCommandHandler(), InitDitherers(), ExportPluginRegistry::Initialize(), Importer::Initialize(), ModuleManager::Initialize(), PluginManager::Initialize(), kAudacityAppTimerID, key, KeyConfigPrefsFactory(), mTimer, ProjectManager::New(), ParseCommandLine(), FileNames::PreferenceKey(), project, QuitAudacity(), audacity::BasicSettings::Read(), Setting< T >::Read(), MenuCreator::RebuildAllMenuBars(), anonymous_namespace{CompareAudioCommand.cpp}::reg, URLSchemesRegistry::RegisterScheme(), MenuCreator::RemoveDuplicateShortcuts(), RunBenchmark(), SafeMRUOpen(), safenew, anonymous_namespace{wxCommandTargets.cpp}::scope, Journal::SetInputFileName(), Sequence::SetMaxDiskBlockSize(), ShowAutoRecoveryDialogIfNeeded(), PrefsDialog::ShowModal(), SkipEffectsScanAtStartup, UpdateManager::Start(), Startup, audacity::BasicSettings::Write(), wxImage(), and wxT().
Referenced by OnInit().
|
private |
Definition at line 1829 of file AudacityApp.cpp.
References AudacityMessageBox(), TempDirectory::DefaultTempDir(), DirectoriesPrefsFactory(), TempDirectory::IsTempDirectoryNameOK(), OSFILENAME, TempDirectory::ResetTempDir(), SetToExtantDirectory(), PrefsDialog::ShowModal(), TempDirectory::TempDir(), FileNames::UpdateDefaultPath(), wxT(), and XO().
Referenced by OnInit().
void AudacityApp::MacActivateApp | ( | ) |
void AudacityApp::MacFinishLaunching | ( | ) |
|
override |
Definition at line 951 of file AudacityApp.cpp.
References AllProjects::empty(), gInited, and ProjectManager::New().
|
override |
Definition at line 939 of file AudacityApp.cpp.
References ofqueue.
|
override |
Definition at line 945 of file AudacityApp.cpp.
References ofqueue.
bool AudacityApp::MRUOpen | ( | const FilePath & | fileName | ) |
void AudacityApp::OnEndSession | ( | wxCloseEvent & | event | ) |
Definition at line 2415 of file AudacityApp.cpp.
References CloseAllProjects(), gIsQuitting, ProjectManager::SaveWindowSize(), and AllProjects::size().
Referenced by OnQueryEndSession().
|
override |
Definition at line 1176 of file AudacityApp.cpp.
References BasicUI::CallAfter(), PendingTracks::ClearPendingTracks(), AudacityException::DelayedHandlerAction(), ProjectHistory::Get(), PendingTracks::Get(), Viewport::Get(), GetActiveProject(), Viewport::Redraw(), and ProjectHistory::RollbackState().
Referenced by OnIdle().
|
override |
Definition at line 2434 of file AudacityApp.cpp.
References AudioIO::Deinit(), DeinitFFT(), audacity::BasicSettings::DeleteEntry(), TypeSwitch::Dispatch(), FinishPreferences(), audacity::BasicSettings::Flush(), Importer::Get(), PluginManager::Get(), audacity::network_manager::NetworkManager::GetInstance(), gIsQuitting, FileHistory::Global(), gPrefs, AppEvents::ProviderBase::HandleAppClosing(), audacity::BasicSettings::Read(), FileHistory::Save(), Importer::Terminate(), PluginManager::Terminate(), audacity::network_manager::NetworkManager::Terminate(), audacity::BasicSettings::Write(), and wxT().
|
override |
Definition at line 1160 of file AudacityApp.cpp.
void AudacityApp::OnIdle | ( | wxIdleEvent & | evt | ) |
Definition at line 1757 of file AudacityApp.cpp.
References Journal::Dispatch(), AppEvents::ProviderBase::HandleAppIdle(), and OnExceptionInMainLoop().
|
override |
Definition at line 1341 of file AudacityApp.cpp.
References GlobalHook< ApplicationSettings, std::unique_ptr< BasicSettings >()>::Call(), BasicUI::CallAfter(), FinishPreferences(), AColor::Init(), FileNames::InitializePathList(), InitPart2(), InitPreferences(), InitTempDir(), ThemeResources::Load(), ThemeBase::LoadPreferredTheme(), MacFinishLaunching(), mThemeChangeSubscription, OnInit0(), OnThemeChange(), anonymous_namespace{AudacityApp.cpp}::PopulatePreferences(), Observer::Publisher< Message, NotifyAll >::Subscribe(), and theTheme.
|
private |
Definition at line 1260 of file AudacityApp.cpp.
References AppName, AudacityMessageBox(), BasicUI::CallAfter(), AudacityLogger::Get(), GetProjectFrame(), ProjectFileIO::InitializeSQL(), BasicUI::Install(), project, QuitAudacity(), safenew, anonymous_namespace{wxCommandTargets.cpp}::scope, and XO().
Referenced by OnInit().
void AudacityApp::OnKeyDown | ( | wxKeyEvent & | event | ) |
Definition at line 1788 of file AudacityApp.cpp.
References AudioIO::Get(), ProjectAudioIO::Get(), ProjectAudioManager::Get(), Scrubber::Get(), GetActiveProject(), ProjectAudioIO::GetAudioIOToken(), project, and ProjectAudioManager::Stop().
void AudacityApp::OnMenuAbout | ( | wxCommandEvent & | event | ) |
Definition at line 2486 of file AudacityApp.cpp.
References AboutDialog::ActiveIntance(), safenew, and ExportProgressUI::Show().
void AudacityApp::OnMenuExit | ( | wxCommandEvent & | event | ) |
Definition at line 2553 of file AudacityApp.cpp.
References AllProjects::empty(), and QuitAudacity().
void AudacityApp::OnMenuNew | ( | wxCommandEvent & | event | ) |
Definition at line 2504 of file AudacityApp.cpp.
References AllProjects::empty(), and ProjectManager::New().
void AudacityApp::OnMenuOpen | ( | wxCommandEvent & | event | ) |
Definition at line 2519 of file AudacityApp.cpp.
References AllProjects::empty(), and ProjectManager::OpenFiles().
void AudacityApp::OnMenuPreferences | ( | wxCommandEvent & | event | ) |
Definition at line 2536 of file AudacityApp.cpp.
References AllProjects::empty(), and PrefsDialog::ShowModal().
void AudacityApp::OnMRUClear | ( | wxCommandEvent & | event | ) |
Definition at line 1063 of file AudacityApp.cpp.
References FileHistory::Clear(), and FileHistory::Global().
void AudacityApp::OnMRUFile | ( | wxCommandEvent & | event | ) |
Definition at line 1071 of file AudacityApp.cpp.
References FileHistory::Global(), FileHistory::ID_RECENT_FIRST, ProjectFileManager::IsAlreadyOpen(), and MRUOpen().
void AudacityApp::OnQueryEndSession | ( | wxCloseEvent & | event | ) |
Definition at line 2401 of file AudacityApp.cpp.
References OnEndSession().
void AudacityApp::OnReceiveCommand | ( | AppCommandEvent & | event | ) |
Definition at line 1782 of file AudacityApp.cpp.
References mCmdHandler.
|
override |
Definition at line 1747 of file AudacityApp.cpp.
References Journal::GetExitCode().
void AudacityApp::OnServerEvent | ( | wxSocketEvent & | evt | ) |
void AudacityApp::OnSocketEvent | ( | wxSocketEvent & | evt | ) |
|
static |
void AudacityApp::OnTimer | ( | wxTimerEvent & | event | ) |
Definition at line 1088 of file AudacityApp.cpp.
References TranslatableString::empty(), URLSchemesRegistry::Get(), GetActiveProject(), GetProjectFrame(), gInited, URLSchemesRegistry::HandleURL(), name, ofqueue, project, SafeMRUOpen(), and wxT().
|
override |
Definition at line 1249 of file AudacityApp.cpp.
References IMPLEMENT_WX_THEME_SUPPORT::sOSXIsGUIApplication.
|
private |
Definition at line 2352 of file AudacityApp.cpp.
References _, CommandLineArgs::argc, CommandLineArgs::argv, and wxT().
Referenced by CreateSingleInstanceChecker(), and InitPart2().
bool AudacityApp::SafeMRUOpen | ( | const wxString & | fileName | ) |
Definition at line 1058 of file AudacityApp.cpp.
References MRUOpen().
Referenced by InitPart2(), and OnTimer().
|
private |
Definition at line 119 of file AudacityApp.h.
Referenced by CreateSingleInstanceChecker().
|
private |
Definition at line 117 of file AudacityApp.h.
Referenced by InitCommandHandler(), and OnReceiveCommand().
|
private |
Definition at line 131 of file AudacityApp.h.
Referenced by CreateSingleInstanceChecker().
|
private |
Definition at line 115 of file AudacityApp.h.
Referenced by OnInit().
|
private |
Definition at line 121 of file AudacityApp.h.
Referenced by InitPart2().