Ticket #10804: videomarkup2.patch

File videomarkup2.patch, 5.0 KB (added by Jim Stichnoth, 11 years ago)
  • mythtv/libs/libmythbase/mythcommandlineparser.cpp

    diff --git a/mythtv/libs/libmythbase/mythcommandlineparser.cpp b/mythtv/libs/libmythbase/mythcommandlineparser.cpp
    index 04ab38b..b5cb1d8 100644
    a b void MythCommandLineParser::addRecording(void) 
    23452345        ->SetRequires("starttime");
    23462346
    23472347    add("--starttime", "starttime", QDateTime(),
    2348             "Specify start time of recording to operate on.", "");
     2348            "Specify start time of recording to operate on.", "")
     2349        ->SetRequires("chanid");
    23492350}
    23502351
    23512352/** \brief Canned argument definition for --geometry
  • mythtv/programs/mythutil/commandlineparser.cpp

    diff --git a/mythtv/programs/mythutil/commandlineparser.cpp b/mythtv/programs/mythutil/commandlineparser.cpp
    index 141235d..3a6297a 100644
    a b MythUtilCommandLineParser::MythUtilCommandLineParser() : 
    1010
    1111void MythUtilCommandLineParser::LoadArguments(void)
    1212{
     13    QStringList ChanidStartimeVideo;
     14    ChanidStartimeVideo << "chanid" << "starttime" << "video";
    1315    CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
    1416        // fileutils.cpp
    1517        << add("--copyfile", "copyfile", false,
    void MythUtilCommandLineParser::LoadArguments(void) 
    4042        << add("--gencutlist", "gencutlist", false,
    4143                "Copy the commercial skip list to the cutlist.", "")
    4244                ->SetGroup("Recording Markup")
    43                 ->SetRequiredChild(QStringList("chanid") << "starttime")
     45                ->SetParentOf(ChanidStartimeVideo)
    4446        << add("--getcutlist", "getcutlist", false,
    4547                "Display the current cutlist.", "")
    4648                ->SetGroup("Recording Markup")
    47                 ->SetRequiredChild(QStringList("chanid") << "starttime")
     49                ->SetParentOf(ChanidStartimeVideo)
    4850        << add("--setcutlist", "setcutlist", "",
    4951                "Set a new cutlist in the form:\n"
    5052                "#-#[,#-#]... (ie, 1-100,1520-3012,4091-5094)", "")
    5153                ->SetGroup("Recording Markup")
    52                 ->SetRequiredChild(QStringList("chanid") << "starttime")
     54                ->SetParentOf(ChanidStartimeVideo)
    5355        << add("--clearcutlist", "clearcutlist", false,
    5456                "Clear the cutlist.", "")
    5557                ->SetGroup("Recording Markup")
    56                 ->SetRequiredChild(QStringList("chanid") << "starttime")
     58                ->SetParentOf(ChanidStartimeVideo)
    5759        << add("--getskiplist", "getskiplist", false,
    5860                "Display the current commercial skip list.", "")
    5961                ->SetGroup("Recording Markup")
    60                 ->SetRequiredChild(QStringList("chanid") << "starttime")
     62                ->SetParentOf(ChanidStartimeVideo)
    6163        << add("--setskiplist", "setskiplist", "",
    6264                "Set a new commercial skip list in the form:\n"
    6365                "#-#[,#-#]... (ie, 1-100,1520-3012,4091-5094)", "")
    6466                ->SetGroup("Recording Markup")
    65                 ->SetRequiredChild(QStringList("chanid") << "starttime")
     67                ->SetParentOf(ChanidStartimeVideo)
    6668        << add("--clearskiplist", "clearskiplist", false,
    6769                "Clear the commercial skip list.", "")
    6870                ->SetGroup("Recording Markup")
    69                 ->SetRequiredChild(QStringList("chanid") << "starttime")
     71                ->SetParentOf(ChanidStartimeVideo)
    7072        << add("--clearseektable", "clearseektable", false,
    7173                "Clear the seek table.", "")
    7274                ->SetGroup("Recording Markup")
    73                 ->SetRequiredChild(QStringList("chanid") << "starttime")
     75                ->SetParentOf(ChanidStartimeVideo)
    7476
    7577        // backendutils.cpp
    7678        << add("--resched", "resched", false,
    void MythUtilCommandLineParser::LoadArguments(void) 
    191193    addVersion();
    192194    addLogging();
    193195    allowExtras();
     196    // Note: This globally prevents --chanid and --video from being
     197    // used together, but this is almost certainly a valid restriction
     198    // in all cases.
     199    CommandLineArg::AllowOneOf(QList<CommandLineArg*>() <<
     200                               new CommandLineArg("chanid") <<
     201                               add("--video", "video", "",
     202                                   "Specify path name of Video Gallery video "
     203                                   "to operate on.", ""));
    194204}
    195205
    196206QString MythUtilCommandLineParser::GetHelpHeader(void) const
  • mythtv/programs/mythutil/mythutil.cpp

    diff --git a/mythtv/programs/mythutil/mythutil.cpp b/mythtv/programs/mythutil/mythutil.cpp
    index 9e88e51..373656a 100644
    a b  
    1111bool GetProgramInfo(const MythUtilCommandLineParser &cmdline,
    1212                    ProgramInfo &pginfo)
    1313{
     14    if (cmdline.toBool("video"))
     15    {
     16        QString video = cmdline.toString("video");
     17        pginfo = ProgramInfo(video);
     18        return true;
     19    }
    1420    if (!cmdline.toBool("chanid"))
    1521    {
    1622        LOG(VB_GENERAL, LOG_ERR, "No chanid specified");