2 changes: 1 addition & 1 deletion mythtv/programs/mythbackend/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <QDir>
#include <QMap>

#include "mythcommandlineparser.h"
#include "commandlineparser.h"
#include "scheduledrecording.h"
#include "previewgenerator.h"
#include "mythcorecontext.h"
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythbackend/main_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include "dbcheck.h"
#include "jobqueue.h"
#include "previewgenerator.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"
#include "mythsystemevent.h"
#include "main_helpers.h"
#include "backendcontext.h"
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythbackend/mythbackend.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ HEADERS += autoexpire.h encoderlink.h filetransfer.h httpstatus.h mainserver.h
HEADERS += playbacksock.h scheduler.h server.h housekeeper.h backendutil.h
HEADERS += upnpcdstv.h upnpcdsmusic.h upnpcdsvideo.h mediaserver.h
HEADERS += internetContent.h main_helpers.h backendcontext.h
HEADERS += httpconfig.h mythsettings.h
HEADERS += httpconfig.h mythsettings.h commandlineparser.h

HEADERS += serviceHosts/mythServiceHost.h serviceHosts/guideServiceHost.h
HEADERS += serviceHosts/contentServiceHost.h serviceHosts/dvrServiceHost.h
Expand All @@ -36,7 +36,7 @@ SOURCES += main.cpp mainserver.cpp playbacksock.cpp scheduler.cpp server.cpp
SOURCES += housekeeper.cpp backendutil.cpp
SOURCES += upnpcdstv.cpp upnpcdsmusic.cpp upnpcdsvideo.cpp mediaserver.cpp
SOURCES += internetContent.cpp main_helpers.cpp backendcontext.cpp
SOURCES += httpconfig.cpp mythsettings.cpp
SOURCES += httpconfig.cpp mythsettings.cpp commandlineparser.cpp

SOURCES += services/myth.cpp services/guide.cpp services/content.cpp
SOURCES += services/dvr.cpp services/channel.cpp services/video.cpp
Expand Down
48 changes: 48 additions & 0 deletions mythtv/programs/mythcommflag/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythCommFlagCommandLineParser::MythCommFlagCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHCOMMFLAG)
{ LoadArguments(); }

void MythCommFlagCommandLineParser::LoadArguments(void)
{
addHelp();
addSettingsOverride();
addVersion();
addVerbose();
addJob();
addRecording();
addLogging();

add(QStringList( QStringList() << "-f" << "--file" ), "file", "",
"Specify file to operate on.", "");
add("--video", "video", "", "Rebuild the seek table for a video (non-recording) file.", "");
add("--method", "commmethod", "", "Commercial flagging method[s] to employ:\n"
"off, blank, scene, blankscene, logo, all, "
"d2, d2_logo, d2_blank, d2_scene, d2_all", "");
add("--outputmethod", "outputmethod", "",
"Format of output written to outputfile, essentials, full.", "");
add("--gencutlist", "gencutlist", "Copy the commercial skip list to the cutlist.", "");
add("--clearcutlist", "clearcutlist", "Clear the cutlist.", "");
add("--clearskiplist", "clearskiplist", "Clear the commercial skip list.", "");
add("--getcutlist", "getcutlist", "Display the current cutlist.", "");
add("--getskiplist", "getskiplist", "Display the current commercial skip list.", "");
add("--setcutlist", "setcutlist", "", "Set a new cutlist in the form:\n"
"#-#[,#-#]... (ie, 1-100,1520-3012,4091-5094)", "");
add("--skipdb", "skipdb", "", "Intended for external 3rd party use.");
add("--queue", "queue", "Insert flagging job into the JobQueue, rather than "
"running flagging in the foreground.", "");
add("--noprogress", "noprogress", "Don't print progress on stdout.", "");
add("--rebuild", "rebuild", "Do not flag commercials, just rebuild the seektable.", "");
add("--force", "force", "Force operation, even if program appears to be in use.", "");
add("--dontwritetodb", "dontwritedb", "", "Intended for external 3rd party use.");
add("--onlydumpdb", "dumpdb", "", "?");
add("--outputfile", "outputfile", "", "File to write commercial flagging output [debug].", "");
}

14 changes: 14 additions & 0 deletions mythtv/programs/mythcommflag/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythCommFlagCommandLineParser : public MythCommandLineParser
{
public:
MythCommFlagCommandLineParser();
void LoadArguments(void);
protected:
// QString GetHelpHeader(void) const;
};

2 changes: 1 addition & 1 deletion mythtv/programs/mythcommflag/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using namespace std;
#include "jobqueue.h"
#include "remoteencoder.h"
#include "ringbuffer.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"
#include "mythtranslation.h"
#include "mythlogging.h"

Expand Down
3 changes: 2 additions & 1 deletion mythtv/programs/mythcommflag/mythcommflag.pro
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ HEADERS += PrePostRollFlagger.h

HEADERS += LogoDetectorBase.h SceneChangeDetectorBase.h
HEADERS += SlotRelayer.h CustomEventRelayer.h
HEADERS += commandlineparser.h

SOURCES += CommDetectorFactory.cpp CommDetectorBase.cpp
SOURCES += ClassicLogoDetector.cpp
Expand All @@ -47,7 +48,7 @@ SOURCES += BlankFrameDetector.cpp
SOURCES += SceneChangeDetector.cpp
SOURCES += PrePostRollFlagger.cpp

SOURCES += main.cpp
SOURCES += main.cpp commandlineparser.cpp

#The following line was inserted by qt3to4
QT += xml sql network
Expand Down
156 changes: 156 additions & 0 deletions mythtv/programs/mythfilldatabase/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythFillDatabaseCommandLineParser::MythFillDatabaseCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHFILLDATABASE)
{ LoadArguments(); }

void MythFillDatabaseCommandLineParser::LoadArguments(void)
{
addHelp();
addVersion();
addVerbose();
addLogging();

add("--manual", "manual", "Run interactive configuration",
"Manual mode will interactively ask you questions about "
"each channel as it is processed, to configure for "
"future use."
"mutually exclusive with --update");
add("--update", "update", "Run non-destructive updates",
"Run non-destructive updates on the database for "
"users in xmltv zones that do not provide channel "
"data. Stops the addition of new channels and the "
"changing of channel icons."
"mutually exclusive with --manual");
add("--preset", "preset", "Use channel preset values instead of numbers",
"For use with assigning preset numbers for each "
"channel. Useful for non-US countries where people "
"are used to assigning a sequenced number for each "
"channel:\n1->TVE1(S41), 2->La 2(SE18), 3->TV(21)...");
add("--file", "file", "Bypass grabbers and define sourceid and file",
"Directly define the sourceid and XMLTV file to "
"import. Must be used in combination with:"
" --sourceid --xmlfile");
add("--dd-file", "file", "Bypass grabber, and read SD data from file",
"Directly define the data needed to import a local "
"DataDirect download. Must be used in combination "
"with: \n"
" --sourceid --lineupid --offset --xmlfile");
add("--sourceid", "sourceid", 0, "Operate on single source",
"Limit mythfilldatabase to only operate on the "
"specified channel source. This option is required "
"when using --file, --dd-file, or --xawchannels.");
add("--offset", "offset", 0, "Day offset of input xml file"
"Specify how many days offset from today is the "
"information in the given XML file. This option is "
"required when using --dd-file.");
add("--lineupid", "lineupid", 0, "DataDirect lineup of input xml file"
"Specify the DataDirect lineup that corresponds to "
"the information in the given XML file. This option "
"is required when using --dd-file.");
add("--xmlfile", "xmlfile", "", "XML file to import manually",
"Specify an XML guide data file to import directly "
"rather than pull data through the specified grabber.\n"
"This option is required when using --file or --dd-file.");
add("--xawchannels", "xawchannels", "Read channels from xawtvrc file",
"Import channels from an xawtvrc file.\nThis option "
"requires --sourceid and --xawtvrcfile.");
add("--xawtvrcfile", "xawtvrcfile", "", "xawtvrc file to import channels from",
"Xawtvrc file containing channels to be imported.\n"
"This option is required when using --xawchannels.");
add("--do-channel-updates", "dochannelupdates", "update channels using datadirect",
"When using DataDirect, ask mythfilldatabase to "
"overwrite channel names, frequencies, etc. with "
"values available from the data source. This will "
"override custom channel names, which is why it "
"is disabled by default.");
add("--remove-new-channels", "removechannels",
"disable new channels on datadirect web interface",
"When using DataDirect, ask mythfilldatabase to "
"mark any new channels as disabled on the remote "
"lineup. Channels can be manually enabled on the "
"website at a later time, and incorporated into "
"MythTV by running mythfilldatabase without this "
"option. New digital channels cannot be directly "
"imported and thus are disabled automatically.");
add("--do-not-filter-new-channels", "nofilterchannels",
"don't filter ATSC channels for addition",
"Normally, MythTV tries to avoid adding ATSC "
"channels to NTSC channel lineups. This option "
"restores the behavior of adding every channel in "
"the downloaded channel lineup to MythTV's lineup, "
"in case MythTV's smarts fail you.");
add("--graboptions", "graboptions", "", "",
"Manually define options to pass to the data grabber. "
"Do NOT use this option unless you know what you are "
"doing. Mythfilldatabase will automatically use the "
"correct options for xmltv compliant grabbers.");
add("--cardtype", "cardtype", "", "", "No information."); // need documentation for this one
add("--max-days", "maxdays", 0, "force number of days to update",
"Force the maximum number of days, counting today, "
"for the guide data grabber to check for future "
"listings.");
add("--refresh-today", "refreshtoday", "refresh today's listings",
"This option is only valid for selected grabbers.\n"
"Force a refresh for today's guide data.\nThis can be used "
"in combination with other --refresh-<n> options.\n"
"If being used with datadirect, this option should not be "
"used, rather use --dd-grab-all to pull all listings each time.");
add("--dont-refresh-tomorrow", "dontrefreshtomorrow",
"don't refresh tomorrow's listings",
"This option is only valid for selected grabbers.\n"
"Prevent mythfilldatabase from pulling information for "
"tomorrow's listings. Data for tomorrow is always pulled "
"unless specifically specified otherwise.\n"
"If being used with datadirect, this option should not be "
"used, rather use --dd-grab-all to pull all listings each time.");
add("--refresh-second", "refreshsecond", "refresh listings two days from now",
"This option is only valid for selected grabbers.\n"
"Force a refresh for guide data two days from now. This can "
"be used in combination with other --refresh-<n> options.\n"
"If being used with datadirect, this option should not be "
"used, rather use --dd-grab-all to pull all listings each time.");
add("--refresh-all", "refreshall", "refresh listings on all days",
"This option is only valid for selected grabbers.\n"
"This option forces a refresh of all guide data, but does so "
"with fourteen downloads of one day each.\n"
"If being used with datadirect, this option should not be "
"used, rather use --dd-grab-all to pull all listings each time.");
// TODO: I should be converted to a qstringlist and used in place of
// the other refresh options
add("--refresh-day", "refreshday", 0U, "refresh specific day's listings",
"This option is only valid for selected grabbers.\n"
"Force a refresh for guide data on a specific day. This can "
"be used in combination with other --refresh-<n> options.\n"
"If being used with datadirect, this option should not be "
"used, rather use --dd-grab-all to pull all listings each time.");
add("--dont-refresh-tba", "dontrefreshtba",
"don't refresh \"To be announced\" programs",
"This option is only valid for selected grabbers.\n"
"Prevent mythfilldatabase from automatically refreshing any "
"programs marked as \"To be announced\".\n"
"If being used with datadirect, this option should not be "
"used, rather use --dd-grab-all to pull all listings each time.");
add("--dd-grab-all", "ddgraball", "refresh full data using DataDirect",
"This option is only valid for selected grabbers (DataDirect).\n"
"This option is the preferred way of updating guide data from "
"DataDirect, and pulls all fourteen days of guide data at once.");
add("--only-update-channels", "onlychannels", "only update channel lineup",
"Download as little listings data as possible to update the "
"channel lineup.");
add("--no-mark-repeats", "markrepeats", true, "do not mark repeats", "");
add("--export-icon-map", "exporticonmap", "iconmap.xml",
"export icon map to file", "");
add("--import-icon-map", "importiconmap", "iconmap.xml",
"import icon map to file", "");
add("--update-icon-map", "updateiconmap", "updates icon map icons", "");
add("--reset-icon-map", "reseticonmap", "", "resets icon maps",
"Reset all icon maps. If given 'all' as an optional value, reset "
"channel icons as well.");
}
14 changes: 14 additions & 0 deletions mythtv/programs/mythfilldatabase/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythFillDatabaseCommandLineParser : public MythCommandLineParser
{
public:
MythFillDatabaseCommandLineParser();
void LoadArguments(void);
protected:
// QString GetHelpHeader(void) const;
};

2 changes: 1 addition & 1 deletion mythtv/programs/mythfilldatabase/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ using namespace std;
#include "mythconfig.h"

// libmythtv headers
#include "mythcommandlineparser.h"
#include "commandlineparser.h"
#include "scheduledrecording.h"
#include "remoteutil.h"
#include "videosource.h" // for is_grabber..
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythfilldatabase/mythfilldatabase.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ DEPENDPATH += ../../libs/libmythtv/mpeg
# Input
HEADERS += filldata.h channeldata.h
HEADERS += icondata.h xmltvparser.h
HEADERS += fillutil.h
HEADERS += fillutil.h commandlineparser.h
SOURCES += filldata.cpp channeldata.cpp
SOURCES += icondata.cpp xmltvparser.cpp
SOURCES += fillutil.cpp
SOURCES += main.cpp
SOURCES += main.cpp commandlineparser.cpp
39 changes: 39 additions & 0 deletions mythtv/programs/mythfrontend/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythFrontendCommandLineParser::MythFrontendCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHFRONTEND)
{ LoadArguments(); }

void MythFrontendCommandLineParser::LoadArguments(void)
{
addHelp();
addVersion();
addWindowed(false);
addSettingsOverride();
addVerbose();
addGeometry();
addDisplay();
addUPnP();
addLogging();

add(QStringList( QStringList() << "-r" << "--reset" ), "reset",
"Resets appearance, settings, and language.", "");
add(QStringList( QStringList() << "-p" << "--prompt" ), "prompt",
"Always prompt for backend selection.", "");
add(QStringList( QStringList() << "-d" << "--disable-autodiscovery" ),
"noautodiscovery", "Prevent frontend from using UPnP autodiscovery.", "");
}

QString MythFrontendCommandLineParser::GetHelpHeader(void) const
{
return "MythFrontend is the primary playback application for MythTV. It \n"
"is used for playback of scheduled and live recordings, and management \n"
"of recording rules.";
}

14 changes: 14 additions & 0 deletions mythtv/programs/mythfrontend/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythFrontendCommandLineParser : public MythCommandLineParser
{
public:
MythFrontendCommandLineParser();
void LoadArguments(void);
protected:
QString GetHelpHeader(void) const;
};

2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ using namespace std;
#include "lcddevice.h"
#include "langsettings.h"
#include "mythtranslation.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"
#include "channelgroupsettings.h"

#include "myththemedmenu.h"
Expand Down
2 changes: 2 additions & 0 deletions mythtv/programs/mythfrontend/mythfrontend.pro
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ HEADERS += videoplayercommand.h videopopups.h
HEADERS += videofilter.h videolist.h
HEADERS += videoplayersettings.h videodlg.h
HEADERS += videoglobalsettings.h upnpscanner.h
HEADERS += commandlineparser.h

SOURCES += main.cpp playbackbox.cpp viewscheduled.cpp audiogeneralsettings.cpp
SOURCES += globalsettings.cpp manualschedule.cpp programrecpriority.cpp
Expand All @@ -59,6 +60,7 @@ SOURCES += videoplayercommand.cpp videopopups.cpp
SOURCES += videofilter.cpp videolist.cpp
SOURCES += videoplayersettings.cpp videodlg.cpp
SOURCES += videoglobalsettings.cpp upnpscanner.cpp
SOURCES += commandlineparser.cpp

macx {
mac_bundle {
Expand Down
29 changes: 29 additions & 0 deletions mythtv/programs/mythjobqueue/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythJobQueueCommandLineParser::MythJobQueueCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHJOBQUEUE)
{ LoadArguments(); }

QString MythJobQueueCommandLineParser::GetHelpHeader(void) const
{
return "MythJobqueue is daemon implementing the job queue. It is intended \n"
"for use as additional processing power without requiring a full backend.";
}

void MythJobQueueCommandLineParser::LoadArguments(void)
{
addHelp();
addSettingsOverride();
addVersion();
addVerbose();
addLogging();
addPIDFile();
addDaemon();
}

14 changes: 14 additions & 0 deletions mythtv/programs/mythjobqueue/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythJobQueueCommandLineParser : public MythCommandLineParser
{
public:
MythJobQueueCommandLineParser();
void LoadArguments(void);
protected:
QString GetHelpHeader(void) const;
};

2 changes: 1 addition & 1 deletion mythtv/programs/mythjobqueue/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "jobqueue.h"
#include "mythdbcon.h"
#include "mythversion.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"
#include "compat.h"
#include "mythsystemevent.h"
#include "mythlogging.h"
Expand Down
4 changes: 3 additions & 1 deletion mythtv/programs/mythjobqueue/mythjobqueue.pro
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ INSTALLS = target
QMAKE_CLEAN += $(TARGET)

# Input
SOURCES += main.cpp
HEADERS += commandlineparser.h

SOURCES += main.cpp commandlineparser.cpp
31 changes: 31 additions & 0 deletions mythtv/programs/mythlcdserver/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythLCDServerCommandLineParser::MythLCDServerCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHLCDSERVER)
{ LoadArguments(); }

void MythLCDServerCommandLineParser::LoadArguments(void)
{
addHelp();
addVersion();
addVerbose();
addDaemon();
addLogging();
//addPIDFile();

add(QStringList( QStringList() << "-p" << "--port" ), "port", 6545, "listen port",
"This is the port MythLCDServer will listen on for events.");
add(QStringList( QStringList() << "-m" << "--startupmessage" ), "message", "",
"Message to display on startup.", "");
add(QStringList( QStringList() << "-t" << "--messagetime"), "messagetime", 30,
"Message display duration (in seconds)", "");
add(QStringList( QStringList() << "-x" << "--debuglevel" ), "debug", 0,
"debug verbosity", "Control debugging verbosity, values from 0-10");
}

14 changes: 14 additions & 0 deletions mythtv/programs/mythlcdserver/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythLCDServerCommandLineParser : public MythCommandLineParser
{
public:
MythLCDServerCommandLineParser();
void LoadArguments(void);
protected:
// QString GetHelpHeader(void) const;
};

2 changes: 1 addition & 1 deletion mythtv/programs/mythlcdserver/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using namespace std;
#include "tv_play.h"
#include "compat.h"
#include "mythtranslation.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"

#include "lcdserver.h"

Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythlcdserver/mythlcdserver.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ target.path = $${PREFIX}/bin

INSTALLS += target

HEADERS += lcdserver.h lcdprocclient.h
HEADERS += lcdserver.h lcdprocclient.h commandlineparser.h

SOURCES += main.cpp lcdserver.cpp lcdprocclient.cpp
SOURCES += main.cpp lcdserver.cpp lcdprocclient.cpp commandlineparser.cpp

QT += network xml sql

Expand Down
30 changes: 30 additions & 0 deletions mythtv/programs/mythmediaserver/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythMediaServerCommandLineParser::MythMediaServerCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHMEDIASERVER)
{ LoadArguments(); }

QString MythMediaServerCommandLineParser::GetHelpHeader(void) const
{
return "MythMediaServer is a daemon implementing the backend file server. \n"
"It is intended to allow access to remote file storage on machines \n"
"that do not have tuners, and as such cannot run a backend.";
}

void MythMediaServerCommandLineParser::LoadArguments(void)
{
addHelp();
addVersion();
addVerbose();
addSettingsOverride();
addPIDFile();
addDaemon();
addLogging();
}

14 changes: 14 additions & 0 deletions mythtv/programs/mythmediaserver/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythMediaServerCommandLineParser : public MythCommandLineParser
{
public:
MythMediaServerCommandLineParser();
void LoadArguments(void);
protected:
QString GetHelpHeader(void) const;
};

2 changes: 1 addition & 1 deletion mythtv/programs/mythmediaserver/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "mythlogging.h"
#include "mythversion.h"
#include "mythsystemevent.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"

#include "requesthandler/basehandler.h"
#include "requesthandler/fileserverhandler.h"
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythmediaserver/mythmediaserver.pro
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ INSTALLS = target
QMAKE_CLEAN += $(TARGET)

# Input

SOURCES += main.cpp
HEADERS += commandlineparser.h
SOURCES += main.cpp commandlineparser.cpp
26 changes: 26 additions & 0 deletions mythtv/programs/mythmessage/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythMessageCommandLineParser::MythMessageCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHMESSAGE)
{ LoadArguments(); }

void MythMessageCommandLineParser::LoadArguments(void)
{
addHelp();
addVersion();
addVerbose();
allowExtras();

add("--udpport", "port", 6948, "(optional) UDP Port to send to", "");
add("--bcastaddr", "addr", "127.0.0.1",
"(optional) IP address to send to", "");
add("--print-template", "printtemplate",
"Print the template to be sent to the frontend", "");
}

14 changes: 14 additions & 0 deletions mythtv/programs/mythmessage/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythMessageCommandLineParser : public MythCommandLineParser
{
public:
MythMessageCommandLineParser();
void LoadArguments(void);
protected:
// QString GetHelpHeader(void) const;
};

2 changes: 1 addition & 1 deletion mythtv/programs/mythmessage/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ using namespace std;
// MythTV headers
#include "exitcodes.h"
#include "compat.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"

#ifndef VERBOSE
#define VB_IMPORTANT 0
Expand Down
5 changes: 3 additions & 2 deletions mythtv/programs/mythmessage/mythmessage.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include ( ../../settings.pro )
include ( ../../version.pro )
include ( ../programs-libs.pro )

QT += network
QT += network sql

TEMPLATE = app
CONFIG += thread
Expand All @@ -16,6 +16,7 @@ INCLUDEPATH += ../../libs/libmythbase
QMAKE_CLEAN += $(TARGET)

# Input
SOURCES += main.cpp
HEADERS += commandlineparser.h
SOURCES += main.cpp commandlineparser.cpp

mingw: LIBS += -lwinmm -lws2_32
28 changes: 28 additions & 0 deletions mythtv/programs/mythpreviewgen/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythPreviewGeneratorCommandLineParser::MythPreviewGeneratorCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHPREVIEWGEN)
{ LoadArguments(); }

void MythPreviewGeneratorCommandLineParser::LoadArguments(void)
{
addHelp();
addVersion();
addVerbose();
addRecording();
addLogging();

add("--seconds", "seconds", 0LL, "Number of seconds into video to take preview image.", "");
add("--frame", "frame", 0LL, "Number of frames into video to take preview image.", "");
add("--size", "size", QSize(0,0), "Dimensions of preview image.", "");
add("--infile", "inputfile", "", "Input video for preview generation.", "");
add("--outfile", "outputfile", "", "Optional output file for preview generation.", "");
}


15 changes: 15 additions & 0 deletions mythtv/programs/mythpreviewgen/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythPreviewGeneratorCommandLineParser : public MythCommandLineParser
{
public:
MythPreviewGeneratorCommandLineParser();
void LoadArguments(void);
protected:
// QString GetHelpHeader(void) const;
};


2 changes: 1 addition & 1 deletion mythtv/programs/mythpreviewgen/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ using namespace std;
#include "programinfo.h"
#include "dbcheck.h"
#include "previewgenerator.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"
#include "mythsystemevent.h"
#include "mythlogging.h"

Expand Down
4 changes: 3 additions & 1 deletion mythtv/programs/mythpreviewgen/mythpreviewgen.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ INSTALLS = target

QMAKE_CLEAN += $(TARGET)

SOURCES += main.cpp
HEADERS += commandlineparser.h

SOURCES += main.cpp commandlineparser.cpp

using_oss:DEFINES += USING_OSS

Expand Down
60 changes: 60 additions & 0 deletions mythtv/programs/mythshutdown/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythShutdownCommandLineParser::MythShutdownCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHSHUTDOWN)
{ LoadArguments(); }

void MythShutdownCommandLineParser::LoadArguments(void)
{
addHelp();
addVersion();
addVerbose();
addLogging();

add(QStringList( QStringList() << "-w" << "--setwakeup" ), "setwakeup", "",
"Set the wakeup time (yyyy-MM-ddThh:mm:ss)", "");
add(QStringList( QStringList() << "-t" << "--setscheduledwakeup" ), "setschedwakeup",
"Set wakeup time to the next scheduled recording", "");
add(QStringList( QStringList() << "-q" << "--shutdown" ), "shutdown",
"Apply wakeup time to nvram and shutdown.", "");
add(QStringList( QStringList() << "-x" << "--safeshutdown" ), "safeshutdown",
"Check if shutdown is possible, and shutdown", "");
add(QStringList( QStringList() << "-p" << "--startup" ), "startup",
"Check startup status",
"Check startup status\n"
" returns 0 - automatic startup\n"
" 1 - manual startup");
add(QStringList( QStringList() << "-c" << "--check" ), "check", 1,
"Check whether shutdown is possible",
"Check whether shutdown is possible depending on input\n"
" input 0 - dont check recording status\n"
" 1 - do check recording status\n\n"
" returns 0 - ok to shut down\n"
" 1 - not ok, idle check reset");
add(QStringList( QStringList() << "-l" << "--lock" ), "lock",
"disable shutdown", "");
add(QStringList( QStringList() << "-u" << "--unlock" ), "unlock",
"enable shutdown", "");
add(QStringList( QStringList() << "-s" << "--status" ), "status", 1,
"check current status",
"check current status depending on input\n"
" input 0 - dont check recording status\n"
" 1 - do check recording status\n\n"
" returns 0 - Idle\n"
" 1 - Transcoding\n"
" 2 - Commercial Detection\n"
" 4 - Grabbing EPG data\n"
" 8 - Recording (only valid if input=1)\n"
" 16 - Locked\n"
" 32 - Jobs running or pending\n"
" 64 - In daily wakeup/shutdown period\n"
" 128 - Less than 15 minutes to next wakeup period\n"
" 255 - Setup is running");
}

14 changes: 14 additions & 0 deletions mythtv/programs/mythshutdown/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythShutdownCommandLineParser : public MythCommandLineParser
{
public:
MythShutdownCommandLineParser();
void LoadArguments(void);
protected:
// QString GetHelpHeader(void) const;
};

2 changes: 1 addition & 1 deletion mythtv/programs/mythshutdown/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ using namespace std;
#include "tvremoteutil.h"
#include "compat.h"
#include "mythlogging.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"

static void setGlobalSetting(const QString &key, const QString &value)
{
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythshutdown/mythshutdown.pro
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ INSTALLS = target
QMAKE_CLEAN += $(TARGET)

# Input
HEADERS +=
SOURCES += main.cpp
HEADERS += commandlineparser.h
SOURCES += main.cpp commandlineparser.cpp
59 changes: 59 additions & 0 deletions mythtv/programs/mythtranscode/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythTranscodeCommandLineParser::MythTranscodeCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHTRANSCODE)
{ LoadArguments(); }

void MythTranscodeCommandLineParser::LoadArguments(void)
{
addHelp();
addVersion();
addVerbose();
addJob();
addRecording();
addSettingsOverride();
addLogging();

add(QStringList( QStringList() << "-i" << "--infile" ), "inputfile", "",
"Input video for transcoding.", "");
add(QStringList( QStringList() << "-o" << "--outfile" ), "outputfile", "",
"Optional output file for transcoding.", "");
add(QStringList( QStringList() << "-p" << "--profile" ), "profile", "",
"Transcoding profile.", "");
add(QStringList( QStringList() << "-l" << "--honorcutlist" ), "usecutlist",
"", "Specifies whether to use the cutlist.",
"Specifies whether transcode should honor the cutlist and "
"remove the marked off commercials. Optionally takes a "
"a cutlist as an argument when used with --infile.");
add("--inversecut", "inversecut",
"Inverses the cutlist, leaving only the marked off sections.", "");
add(QStringList( QStringList() << "--allkeys" << "-k" ), "allkeys",
"Specifies the outputfile should be entirely keyframes.", "");
add(QStringList( QStringList() << "-f" << "--fifodir" ), "fifodir", "",
"Directory in which to write fifos to.", "");
add("--fifosync", "fifosync", "Enforce fifo sync.", "");
add("--passthrough", "passthru", "Pass through raw, unprocessed audio.", "");
add(QStringList( QStringList() << "-b" << "--buildindex" ), "reindex",
"Build new keyframe index.", "");
add("--video", "video",
"Specifies video is not a recording, must use --infile.", "");
add("--showprogress", "showprogress", "Display status info in stdout", "");
add(QStringList( QStringList() << "-ro" << "--recorderOptions" ), "recopt",
"", "Comma separated list of recordingprofile overrides.", "");
add("--audiotrack", "audiotrack", 0, "Select specific audio track.", "");
add(QStringList( QStringList() << "-m" << "--mpeg2" ), "mpeg2",
"Specifies that a lossless transcode should be used.", "");
add(QStringList( QStringList() << "-e" << "--ostream" ), "ostream", ""
"Output stream type: dvd, ps", "");
add("--queue", "queue", "",
"Add a new transcoding job of the specified recording and "
"profile to the jobqueue. Accepts an optional string to define "
"the hostname.", "");
}

14 changes: 14 additions & 0 deletions mythtv/programs/mythtranscode/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythTranscodeCommandLineParser : public MythCommandLineParser
{
public:
MythTranscodeCommandLineParser();
void LoadArguments(void);
protected:
// QString GetHelpHeader(void) const;
};

2 changes: 1 addition & 1 deletion mythtv/programs/mythtranscode/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using namespace std;
#include "remotefile.h"
#include "mythtranslation.h"
#include "mythlogging.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"
#include "recordinginfo.h"

static void CompleteJob(int jobID, ProgramInfo *pginfo, bool useCutlist,
Expand Down
3 changes: 2 additions & 1 deletion mythtv/programs/mythtranscode/mythtranscode.pro
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ QMAKE_CFLAGS += -w

# Input
SOURCES += main.cpp transcode.cpp mpeg2fix.cpp helper.c
SOURCES += commandlineparser.cpp
SOURCES += replex/element.c replex/mpg_common.c replex/multiplex.c \
replex/pes.c replex/ringbuffer.c replex/ts.c
HEADERS += mpeg2fix.h transcodedefs.h
HEADERS += mpeg2fix.h transcodedefs.h commandlineparser.h
HEADERS += replex/element.h replex/mpg_common.h replex/multiplex.h \
replex/pes.h replex/ringbuffer.h replex/ts.h

Expand Down
59 changes: 59 additions & 0 deletions mythtv/programs/mythtv-setup/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythTVSetupCommandLineParser::MythTVSetupCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHTV_SETUP)
{ LoadArguments(); }

QString MythTVSetupCommandLineParser::GetHelpHeader(void) const
{
return "Mythtv-setup is the setup application for the backend server. It is \n"
"used to configure the backend, and manage tuner cards and storage. \n"
"Most settings will require a restart of the backend before they take \n"
"effect.";
}

void MythTVSetupCommandLineParser::LoadArguments(void)
{
addHelp();
addSettingsOverride();
addVersion();
addWindowed(false);
addVerbose();
addGeometry();
addDisplay();
addLogging();

add("--expert", "expert", "", "Expert mode.");
add("--scan-list", "scanlist", "", "no help");
add("--scan-save-only", "savescan", "", "no help");
add("--scan-non-interactive", "scannoninteractive", "", "nohelp");

add("--scan", "scan", 0U, "",
"Run the command line channel scanner on a specified card "
"ID. This can be used with --frequency-table and --input-name.");
add("--frequency-table", "freqtable", "atsc-vsb8-us", "",
"Specify frequency table to be used with command "
"line channel scanner.");
add("--input-name", "inputname", "", "",
"Specify which input to scan for, if specified card "
"supports multiple.");

add("--scan-import", "importscan", 0U, "",
"Import an existing scan from the database. Use --scan-list "
"to enumerate scans available for import.\n"
"This option is mutually exclusive with --scan, and can "
"be used with the options --FTAonly and --service-type.");
add("--FTAonly", "ftaonly", "", "Only import 'Free To Air' channels.");
add("--service-type", "servicetype", "all", "",
"To be used with channel scanning or importing, specify "
"the type of services to import. Select from the following, "
"multiple can be added with '+':\n"
" all, tv, radio");
}

14 changes: 14 additions & 0 deletions mythtv/programs/mythtv-setup/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythTVSetupCommandLineParser : public MythCommandLineParser
{
public:
MythTVSetupCommandLineParser();
void LoadArguments(void);
protected:
QString GetHelpHeader(void) const;
};

2 changes: 1 addition & 1 deletion mythtv/programs/mythtv-setup/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "startprompt.h"
#include "mythsystemevent.h"
#include "expertsettingseditor.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"

using namespace std;

Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythtv-setup/mythtv-setup.pro
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ using_backend {
# Input
HEADERS += backendsettings.h channeleditor.h checksetup.h
HEADERS += exitprompt.h importicons.h startprompt.h
HEADERS += expertsettingseditor.h
HEADERS += expertsettingseditor.h commandlineparser.h

SOURCES += backendsettings.cpp channeleditor.cpp checksetup.cpp
SOURCES += exitprompt.cpp importicons.cpp startprompt.cpp
SOURCES += main.cpp
SOURCES += main.cpp commandlineparser.cpp

macx {
mac_bundle {
Expand Down
30 changes: 30 additions & 0 deletions mythtv/programs/mythwelcome/commandlineparser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

using namespace std;

#include <QString>

#include "mythcorecontext.h"
#include "commandlineparser.h"

MythWelcomeCommandLineParser::MythWelcomeCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHWELCOME)
{ LoadArguments(); }

QString MythWelcomeCommandLineParser::GetHelpHeader(void) const
{
return "MythWelcome is a graphical launcher application to allow MythFrontend \n"
"to disconnect from the backend, and allow automatic shutdown to occur.";
}

void MythWelcomeCommandLineParser::LoadArguments(void)
{
addHelp();
addSettingsOverride();
addVersion();
addVerbose();
addLogging();

add(QStringList( QStringList() << "-s" << "--setup" ), "setup",
"Run setup for mythshutdown.", "");
}

14 changes: 14 additions & 0 deletions mythtv/programs/mythwelcome/commandlineparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include <QString>

#include "mythcommandlineparser.h"

class MythWelcomeCommandLineParser : public MythCommandLineParser
{
public:
MythWelcomeCommandLineParser();
void LoadArguments(void);
protected:
QString GetHelpHeader(void) const;
};

2 changes: 1 addition & 1 deletion mythtv/programs/mythwelcome/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "exitcodes.h"
#include "compat.h"
#include "lcddevice.h"
#include "mythcommandlineparser.h"
#include "commandlineparser.h"
#include "tv.h"
#include "mythlogging.h"

Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythwelcome/mythwelcome.pro
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ INSTALLS = target
QMAKE_CLEAN += $(TARGET)

# Input
HEADERS += welcomedialog.h welcomesettings.h
SOURCES += main.cpp welcomedialog.cpp welcomesettings.cpp
HEADERS += welcomedialog.h welcomesettings.h commandlineparser.h
SOURCES += main.cpp welcomedialog.cpp welcomesettings.cpp commandlineparser.cpp

macx {
mac_bundle {
Expand Down