static void BuildSystemInfo() { str::Str<char> s(1024); GetProgramInfo(s); GetOsVersion(s); GetSystemInfo(s); gSystemInfo = s.StealData(); }
ProgramInfo *ProgramInfoCache::GetProgramInfo(const QString &piKey) const { uint chanid; QDateTime recstartts; if (ProgramInfo::ExtractKey(piKey, chanid, recstartts)) return GetProgramInfo(chanid, recstartts); return NULL; }
static int QueueJob(const MythUtilCommandLineParser &cmdline) { ProgramInfo pginfo; if (!GetProgramInfo(cmdline, pginfo)) return GENERIC_EXIT_NO_RECORDING_DATA; bool rebuildSeektable = false; int jobType = JOB_NONE; if (cmdline.toString("queuejob") == "transcode") jobType = JOB_TRANSCODE; else if (cmdline.toString("queuejob") == "commflag") jobType = JOB_COMMFLAG; else if (cmdline.toString("queuejob") == "rebuild") { jobType = JOB_COMMFLAG; rebuildSeektable = true; } else if (cmdline.toString("queuejob") == "metadata") jobType = JOB_METADATA; else if (cmdline.toString("queuejob") == "userjob1") jobType = JOB_USERJOB1; else if (cmdline.toString("queuejob") == "userjob2") jobType = JOB_USERJOB1; else if (cmdline.toString("queuejob") == "userjob4") jobType = JOB_USERJOB1; else if (cmdline.toString("queuejob") == "userjob4") jobType = JOB_USERJOB1; else if (cmdline.toInt("queuejob") > 0) jobType = cmdline.toInt("queuejob"); if (jobType == JOB_NONE) { LOG(VB_GENERAL, LOG_ERR, "Error, invalid job type given with queuejob option"); return GENERIC_EXIT_INVALID_CMDLINE; } bool result = JobQueue::QueueJob(jobType, pginfo.GetChanID(), pginfo.GetRecordingStartTime(), "", "", "", rebuildSeektable, JOB_QUEUED, QDateTime()); if (result) { QString tmp = QString("%1 Job Queued for chanid %2 @ %3") .arg(cmdline.toString("queuejob")) .arg(pginfo.GetChanID()) .arg(pginfo.GetRecordingStartTime().toString()); cerr << tmp.toLocal8Bit().constData() << endl; return GENERIC_EXIT_OK; } QString tmp = QString("Error queueing job for chanid %1 @ %2") .arg(pginfo.GetChanID()) .arg(pginfo.GetRecordingStartTime().toString()); cerr << tmp.toLocal8Bit().constData() << endl; return GENERIC_EXIT_DB_ERROR; }
static int GetMarkupList(const MythUtilCommandLineParser &cmdline, const QString type) { ProgramInfo pginfo; if (!GetProgramInfo(cmdline, pginfo)) return GENERIC_EXIT_NO_RECORDING_DATA; frm_dir_map_t cutlist; frm_dir_map_t::const_iterator it; QString result; if (type == "cutlist") pginfo.QueryCutList(cutlist); else pginfo.QueryCommBreakList(cutlist); uint64_t lastStart = 0; for (it = cutlist.begin(); it != cutlist.end(); ++it) { if ((*it == MARK_COMM_START) || (*it == MARK_CUT_START)) { if (!result.isEmpty()) result += ","; lastStart = it.key(); result += QString("%1-").arg(lastStart); } else { if (result.isEmpty()) result += "0-"; result += QString("%1").arg(it.key()); } } if (result.endsWith('-')) { uint64_t lastFrame = pginfo.QueryLastFrameInPosMap() + 60; if (lastFrame > lastStart) result += QString("%1").arg(lastFrame); } if (type == "cutlist") cout << QString("Cutlist: %1\n").arg(result).toLocal8Bit().constData(); else { cout << QString("Commercial Skip List: %1\n") .arg(result).toLocal8Bit().constData(); } return GENERIC_EXIT_OK; }
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; }
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; }
int main(int argc, char **argv) { Object *code, *pm; Object *prog, *objv[2]; Stream *s, *strv[4]; char *dummy = Null(char); word e; #if 0 MCB m; #endif Environ env; if( argc < 2 ) { printf("usage: bounce machine [msgsize [bounces]]\n"); return 20; } msgsize = argc<3?1024:atoi(argv[2]); bounces = argc<4?5000:atoi(argv[3]); if( strcmp("remote",argv[0]) != 0 ) { int i; MachineName(mcname); i = strlen(mcname); while(mcname[--i] != c_dirchar); mcname[i+1] = '\0'; strcat(mcname,argv[1]); strcat(mcname,"/tasks"); pm = Locate(CurrentDir,mcname); code = Locate(CurrentDir,"/loader/bounce"); prog = Execute(pm,code); s = Open(prog,NULL,O_WriteOnly); objv[0] = CurrentDir; objv[1] = Null(Object); strv[0] = Heliosno(stdin); strv[1] = Heliosno(stdout); strv[2] = Heliosno(stderr); strv[3] = Null(Stream); argv[0] = "remote"; env.Argv = argv; env.Envv = &dummy; env.Objv = &objv[0]; env.Strv = &strv[0]; e = SendEnv(s->Server,&env); echo(prog->Reply); #if 0 InitMCB(&m,0,prog->Reply,NullPort,0); m.Timeout = MaxInt; e = GetMsg(&m); #else InitProgramInfo(s,PS_Terminate); e = GetProgramInfo(s,NULL,-1); #endif Close(code); Close(prog); Close(s); Close(pm); } else { bounce(MyTask->Parent,MyTask->Port); } return 0; }