Initializations and cleanups
Initialization
The following steps are the outline of the startup steps of LMMS:
Parse command-line arguments to check if LMMS needs GUI.
Initialize
QCoreApplication
for command-line-only tasks,MainApplication
otherwise.Complete parsing command-line arguments.
Setup miscellaneous environments, e.g., RNG, HiDPI scaling.
Load the configuration file and translations.
Initialize the core by calling
Engine::init()
for CLI cases. When running with GUI,GuiApplication
will initialize it later.Complete remaining steps.
For command-line tasks, handle it in the
main()
.Otherwise:
Start the GUI by instantiating
GuiApplication
.Show the GUI and create/load a project.
Main routine
After initializing everything, LMMS runs the main event loop by calling app->exec()
. Once the event loop returns, the cleanup steps start.
Cleanup
The following steps are the outline of the shutdown steps of LMMS:
Delete the application instance(either
QCoreApplication
orMainApplication
)In the CLI case, destroy the core. It's not the case if the GUI was launched because the destructor of
MainWindow
callsEngine::destroy()
.
Last updated
Was this helpful?