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) |
void | ShowSplashScreen () |
void | HideSplashScreen (bool fadeOut=true) |
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 |
wxTimer | mSplashTimer |
std::unique_ptr< wxSplashScreen > | mSplashScreen |
std::unique_ptr< IPCServ > | mIPCServ |
AudacityApp is the 'main' class for Audacity.
It handles initialization and termination by subclassing wxApp.
Definition at line 39 of file AudacityApp.h.
AudacityApp::AudacityApp | ( | ) |
Definition at line 1237 of file AudacityApp.cpp.
AudacityApp::~AudacityApp | ( | ) |
Definition at line 1267 of file AudacityApp.cpp.
void AudacityApp::AssociateFileTypes | ( | ) |
Definition at line 2661 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 1250 of file AudacityApp.cpp.
References gConfig.
|
private |
Definition at line 1980 of file AudacityApp.cpp.
References AudacityMessageBox(), IPC_APPL, IPC_TOPIC, mChecker, mIPCServ, name, ParseCommandLine(), audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::urlPrefix, wxT(), and XO().
Referenced by InitPart2().
|
private |
Definition at line 1320 of file AudacityApp.cpp.
References anonymous_namespace{RegisterBuiltinEffects.cpp}::fadeOut, mSplashScreen, and mSplashTimer.
Referenced by InitPart2().
|
private |
Definition at line 1849 of file AudacityApp.cpp.
References mCmdHandler.
Referenced by InitPart2().
|
override |
Definition at line 1241 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 1524 of file AudacityApp.cpp.
References _, AppInitialized, AssociateFileTypes(), Journal::Begin(), BasicUI::CallAfter(), PluginManager::CheckPluginUpdates(), AudacityFileConfig::Create(), CreateSingleInstanceChecker(), FileNames::DataDir(), ModuleManager::Dispatch(), FindProjectFrame(), FinishPreferences(), ExportPluginRegistry::Get(), Importer::Get(), ModuleManager::Get(), PluginManager::Get(), URLSchemesRegistry::Get(), MenuCreator::Get(), ProjectSettings::Get(), GetActiveProject(), Languages::GetLocaleName(), GetPreferencesVersion(), ProjectSettings::GetShowSplashScreen(), gInited, FileHistory::Global(), gPrefs, AppEvents::ProviderBase::HandleAppInitialized(), URLSchemesRegistry::HandleURL(), HideSplashScreen(), 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(), WhatsNewDialog::Show(), ShowAutoRecoveryDialogIfNeeded(), PrefsDialog::ShowModal(), ShowSplashScreen(), SkipEffectsScanAtStartup, UpdateManager::Start(), Startup, audacity::BasicSettings::Write(), and wxT().
Referenced by OnInit().
|
private |
Definition at line 1903 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 963 of file AudacityApp.cpp.
References AllProjects::empty(), gInited, and ProjectManager::New().
|
override |
Definition at line 951 of file AudacityApp.cpp.
References ofqueue.
|
override |
Definition at line 957 of file AudacityApp.cpp.
References ofqueue.
bool AudacityApp::MRUOpen | ( | const FilePath & | fileName | ) |
void AudacityApp::OnEndSession | ( | wxCloseEvent & | event | ) |
Definition at line 2489 of file AudacityApp.cpp.
References CloseAllProjects(), gIsQuitting, ProjectManager::SaveWindowSize(), and AllProjects::size().
Referenced by OnQueryEndSession().
|
override |
Definition at line 1188 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 2508 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 1172 of file AudacityApp.cpp.
void AudacityApp::OnIdle | ( | wxIdleEvent & | evt | ) |
Definition at line 1831 of file AudacityApp.cpp.
References Journal::Dispatch(), AppEvents::ProviderBase::HandleAppIdle(), and OnExceptionInMainLoop().
|
override |
Definition at line 1442 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(), RegisterBuiltinEffects(), Observer::Publisher< Message, NotifyAll >::Subscribe(), and theTheme.
|
private |
Definition at line 1361 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 1862 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 2560 of file AudacityApp.cpp.
References AboutDialog::ActiveIntance(), safenew, and ExportProgressUI::Show().
void AudacityApp::OnMenuExit | ( | wxCommandEvent & | event | ) |
Definition at line 2627 of file AudacityApp.cpp.
References AllProjects::empty(), and QuitAudacity().
void AudacityApp::OnMenuNew | ( | wxCommandEvent & | event | ) |
Definition at line 2578 of file AudacityApp.cpp.
References AllProjects::empty(), and ProjectManager::New().
void AudacityApp::OnMenuOpen | ( | wxCommandEvent & | event | ) |
Definition at line 2593 of file AudacityApp.cpp.
References AllProjects::empty(), and ProjectManager::OpenFiles().
void AudacityApp::OnMenuPreferences | ( | wxCommandEvent & | event | ) |
Definition at line 2610 of file AudacityApp.cpp.
References AllProjects::empty(), and PrefsDialog::ShowModal().
void AudacityApp::OnMRUClear | ( | wxCommandEvent & | event | ) |
Definition at line 1075 of file AudacityApp.cpp.
References FileHistory::Clear(), and FileHistory::Global().
void AudacityApp::OnMRUFile | ( | wxCommandEvent & | event | ) |
Definition at line 1083 of file AudacityApp.cpp.
References FileHistory::Global(), FileHistory::ID_RECENT_FIRST, ProjectFileManager::IsAlreadyOpen(), and MRUOpen().
void AudacityApp::OnQueryEndSession | ( | wxCloseEvent & | event | ) |
Definition at line 2475 of file AudacityApp.cpp.
References OnEndSession().
void AudacityApp::OnReceiveCommand | ( | AppCommandEvent & | event | ) |
Definition at line 1856 of file AudacityApp.cpp.
References mCmdHandler.
|
override |
Definition at line 1821 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 1100 of file AudacityApp.cpp.
References URLSchemesRegistry::Get(), GetActiveProject(), GetProjectFrame(), gInited, URLSchemesRegistry::HandleURL(), name, ofqueue, project, SafeMRUOpen(), audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::urlPrefix, and wxT().
|
override |
Definition at line 1261 of file AudacityApp.cpp.
References IMPLEMENT_WX_THEME_SUPPORT::sOSXIsGUIApplication.
|
private |
Definition at line 2426 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 1070 of file AudacityApp.cpp.
References MRUOpen().
Referenced by InitPart2(), and OnTimer().
|
private |
Definition at line 1271 of file AudacityApp.cpp.
References _, GetNextWindowPlacement(), mSplashScreen, and wxImage().
Referenced by InitPart2().
|
private |
Definition at line 120 of file AudacityApp.h.
Referenced by CreateSingleInstanceChecker().
|
private |
Definition at line 118 of file AudacityApp.h.
Referenced by InitCommandHandler(), and OnReceiveCommand().
|
private |
Definition at line 136 of file AudacityApp.h.
Referenced by CreateSingleInstanceChecker().
|
private |
Definition at line 124 of file AudacityApp.h.
Referenced by HideSplashScreen(), and ShowSplashScreen().
|
private |
Definition at line 123 of file AudacityApp.h.
Referenced by HideSplashScreen().
|
private |
Definition at line 116 of file AudacityApp.h.
Referenced by OnInit().
|
private |
Definition at line 122 of file AudacityApp.h.
Referenced by InitPart2().