MCPcopy Create free account
hub / github.com/audacity/audacity / InitPart2

Method InitPart2

src/AudacityApp.cpp:1537–1832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1535}
1536
1537bool AudacityApp::InitPart2()
1538{
1539#if defined(__WXMAC__)
1540 SetExitOnFrameDelete(false);
1541#endif
1542
1543 // Make sure the temp dir isn't locked by another process.
1544 {
1545 auto key =
1546 PreferenceKey(FileNames::Operation::Temp, FileNames::PathType::_None);
1547 auto temp = gPrefs->Read(key);
1548 if (temp.empty() || !CreateSingleInstanceChecker(temp)) {
1549 FinishPreferences();
1550 return false;
1551 }
1552 }
1553
1554 //<<<< Try to avoid dialogs before this point.
1555 // The reason is that InitTempDir starts the single instance checker.
1556 // If we're waiitng in a dialog before then we can very easily
1557 // start multiple instances, defeating the single instance checker.
1558
1559 // Initialize the CommandHandler
1560 InitCommandHandler();
1561
1562 // Initialize the ModuleManager, including loading found modules
1563 ModuleManager::Get().Initialize();
1564
1565 // Initialize the PluginManager
1566 PluginManager::Get().Initialize( [](const FilePath &localFileName){
1567 return std::make_unique<SettingsWX>(
1568 AudacityFileConfig::Create({}, {}, localFileName)
1569 );
1570 });
1571
1572 // Parse command line and handle options that might require
1573 // immediate exit...no need to initialize all of the audio
1574 // stuff to display the version string.
1575 std::shared_ptr< wxCmdLineParser > parser{ ParseCommandLine() };
1576 if (!parser)
1577 {
1578 // Either user requested help or a parsing error occurred
1579 exit(1);
1580 }
1581
1582 wxString journalFileName;
1583 const bool playingJournal = parser->Found("j", &journalFileName);
1584
1585#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) && !defined(__CYGWIN__)
1586 if (!playingJournal)
1587 this->AssociateFileTypes();
1588#endif
1589
1590 if (parser->Found(wxT("v")))
1591 {
1592 wxPrintf("Audacity v%s\n", AUDACITY_VERSION_STRING);
1593 exit(0);
1594 }

Callers

nothing calls this directly

Calls 15

AssociateFileTypesMethod · 0.95
FinishPreferencesFunction · 0.85
GetFunction · 0.85
CreateFunction · 0.85
SetInputFileNameFunction · 0.85
GetActiveFunction · 0.85
InitDitherersFunction · 0.85
InitClass · 0.85
CallAfterFunction · 0.85
GetPreferencesVersionFunction · 0.85
QuitAudacityFunction · 0.85

Tested by

no test coverage detected