Myth startup sequence

Most MythTV programs follow a common sequence:
  1. Process (parse) command-line arguments
  2. Create a MythContext object, which stores paths for later location of runtime assets (filters/fonts/plugins/themes/translations)
  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 mysql.txt,
    • 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/*/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 the value of MCP's m_installprefix variable, which is either the runtime env. var. $MYTHTVDIR or the compile-time var. RUNPREFIX. If these are relative paths, it is initialised relative to the binary location. The value is used thus:
    • GetInstallPrefix() + /share/mythtv/ = GetShareDir(), GetFontsDir()
    • GetInstallPrefix() + /share/mythtv/themes/ = GetThemesParentDir()
    • GetInstallPrefix() + /share/mythtv/i18n/ = GetTranslationsDir()
    • GetInstallPrefix() + /share/mythtv/mytharchive
    • GetInstallPrefix() + /share/mythtv/mytharchive/themes
    • GetInstallPrefix() + /share/mythtv/mytharchive/scripts
    • GetInstallPrefix() + /share/mythtv/mythflix/scripts
    • GetInstallPrefix() + /share/mythtv/mythnews
    • GetInstallPrefix() + /share/mythtv/mythvideo/scripts
    • GetInstallPrefix() + /share/mythtv/mythweather
    • GetInstallPrefix() + /share/mythtv/mythweather/scripts
    • GetInstallPrefix() + /bin/ignyte
    • GetInstallPrefix() + /bin/mythfilldatabase
    • GetInstallPrefix() + /bin/mtd
    • GetInstallPrefix() + /lib/mythtv/ = GetLibraryDir()
    • GetInstallPrefix() + /lib/mythtv/plugins/ = GetPluginsDir()
    • GetInstallPrefix() + /lib/mythtv/filters/ = GetFiltersDir()

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

  3. mysql.txt is loaded from GetShareDir(), GetInstallPrefix() + /etc/mythtv, GetConfDir(), and the current directory. Later files override the values from earlier ones.


Generated on Sat Dec 18 05:15:56 2010 for MythTV by  doxygen 1.5.5