本文整理汇总了C++中ProgramInfo::SaveCutList方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramInfo::SaveCutList方法的具体用法?C++ ProgramInfo::SaveCutList怎么用?C++ ProgramInfo::SaveCutList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramInfo
的用法示例。
在下文中一共展示了ProgramInfo::SaveCutList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetMarkupList
static int SetMarkupList(const MythUtilCommandLineParser &cmdline,
const QString &type, QString newList)
{
ProgramInfo pginfo;
if (!GetProgramInfo(cmdline, pginfo))
return GENERIC_EXIT_NO_RECORDING_DATA;
bool isCutlist = (type == "cutlist");
frm_dir_map_t markuplist;
newList.replace(QRegExp(" "), "");
QStringList tokens = newList.split(",", QString::SkipEmptyParts);
if (newList.isEmpty())
newList = "(EMPTY)";
for (int i = 0; i < tokens.size(); i++)
{
QStringList cutpair = tokens[i].split("-", QString::SkipEmptyParts);
if (isCutlist)
{
markuplist[cutpair[0].toInt()] = MARK_CUT_START;
markuplist[cutpair[1].toInt()] = MARK_CUT_END;
}
else
{
markuplist[cutpair[0].toInt()] = MARK_COMM_START;
markuplist[cutpair[1].toInt()] = MARK_COMM_END;
}
}
if (isCutlist)
{
pginfo.SaveCutList(markuplist);
cout << QString("Cutlist set to: %1\n")
.arg(newList).toLocal8Bit().constData();
LOG(VB_GENERAL, LOG_NOTICE, QString("Cutlist set to: %1").arg(newList));
}
else
{
pginfo.SaveCommBreakList(markuplist);
cout << QString("Commercial Skip List set to: %1\n")
.arg(newList).toLocal8Bit().constData();
LOG(VB_GENERAL, LOG_NOTICE, QString("Commercial Skip List set to: %1").arg(newList));
}
return GENERIC_EXIT_OK;
}
示例2: CopySkipListToCutList
static int CopySkipListToCutList(const MythUtilCommandLineParser &cmdline)
{
ProgramInfo pginfo;
if (!GetProgramInfo(cmdline, pginfo))
return GENERIC_EXIT_NO_RECORDING_DATA;
frm_dir_map_t cutlist;
frm_dir_map_t::const_iterator it;
pginfo.QueryCommBreakList(cutlist);
for (it = cutlist.begin(); it != cutlist.end(); ++it)
if (*it == MARK_COMM_START)
cutlist[it.key()] = MARK_CUT_START;
else
cutlist[it.key()] = MARK_CUT_END;
pginfo.SaveCutList(cutlist);
cout << QString("Cutlist copied to Commercial Skip List\n")
.toLocal8Bit().constData();
return GENERIC_EXIT_OK;
}