Go to the documentation of this file.
13 #include <QCoreApplication>
30 int main(
int argc,
char **argv)
32 int special_port = -1;
33 QString startup_message =
"";
34 int message_time = 30;
58 QCoreApplication a(argc, argv);
66 QString mask(
"general");
73 if (special_port < 1 || special_port > 65534)
75 LOG(VB_GENERAL, LOG_ERR,
"lcdserver: Bad port number");
84 if (message_time < 1 || message_time > 1000)
86 LOG(VB_GENERAL, LOG_ERR,
"lcdserver: Bad message duration");
93 if (debug_level < 0 || debug_level > 10)
95 LOG(VB_GENERAL, LOG_ERR,
"lcdserver: Bad debug level");
101 QList<int> signallist;
102 signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
105 signallist << SIGRTMIN;
115 LOG(VB_GENERAL, LOG_ERR,
116 "lcdserver: Could not initialize MythContext. Exiting.");
127 if (special_port > 0)
129 assigned_port = special_port;
132 auto *server =
new LCDServer(assigned_port, startup_message, message_time);
134 QCoreApplication::exec();
#define MYTH_APPNAME_MYTHLCDSERVER
#define GENERIC_EXIT_OK
Exited with no error.
bool ConnectToMasterServer(bool blockingClient=true, bool openEventSocket=true)
Startup context for MythTV.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
#define GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
int main(int argc, char **argv)
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
static void PrintVersion(void)
Print application version information.
void PrintHelp(void) const
Print command line option help.
int Daemonize(void) const
Fork application into background, and detatch from terminal.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
int GetNumSetting(const QString &key, int defaultval=0)
#define MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
MythCommFlagCommandLineParser cmdline
QString toString(const QString &key) const
Returns stored QVariant as a QString, falling to default if not provided.
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
#define GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
static void SetHandler(int signum, SigHandlerFunc handler)
int ConfigureLogging(const QString &mask="general", bool progress=false)
Read in logging options and initialize the logging interface.
static void load(const QString &module_name)
Load a QTranslator for the user's preferred language.
int toInt(const QString &key) const
Returns stored QVariant as an integer, falling to default if not provided.
MythContext * gContext
This global variable contains the MythContext instance for the application.
bool Init(bool gui=true, bool promptForBackend=false, bool disableAutoDiscovery=false, bool ignoreDB=false)
static void Init(QList< int > &signallist, QObject *parent=nullptr)