MythTV  0.27pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
MythTV Startup Sequence

This line is filler that is ignored by Doxygen. More...

This line is filler that is ignored by Doxygen.

Most MythTV programs follow a common sequence:

  1. Process (parse) command-line arguments
  2. Create a MythContext object (which contains a MythCoreContext object for server and DB communication, logging and some housekeeping)
  3. (optionally) Create a UPnP client or server
  4. Initialise the MythContext, which:
    • Tries to find a database on localhost, or on the host specified in config.xml,
    • Tries to locate exactly one backend host via UPnP, to find its database,
    • If possible, displays a list of all backends located via UPnP for the user to choose from, or
    • Fails
  5. Create the main window/screen, display themed menus, et c.

(examine program/{appname}/main.cpp, and libs/libmyth/mythcontext.cpp, for further detail).

The "runtime assets" mentioned above are stored in a number of well-known locations. The following methods in MythContext allow programs and plugins to access these assets:

  1. GetInstallPrefix() returns either the runtime env. var. $MYTHTVDIR or the compile-time var. RUNPREFIX. If these are relative paths, it is initialised relative to the application's location. The value is used thus:

  2. GetConfDir() returns the value of the runtime env. var. $MYTHCONFDIR, or $HOME/.mythtv

  3. The new config.xml has replaced the old mysql.txt, and is loaded from GetConfDir() only. If not found, MythTV will attempt to discover the database credentials over UPnP from the master backend, falling back to the compiled-in defaults of mythtv:mythtv/mythconverg. If no connection can be established, the necessary information is queried from the user.