本文整理汇总了C++中ProgramInfo::GetPlaybackURL方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramInfo::GetPlaybackURL方法的具体用法?C++ ProgramInfo::GetPlaybackURL怎么用?C++ ProgramInfo::GetPlaybackURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramInfo
的用法示例。
在下文中一共展示了ProgramInfo::GetPlaybackURL方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: extractDetailsFromFilename
ProgramInfo *getProgramInfoForFile(const QString &inFile)
{
ProgramInfo *pinfo = NULL;
QString chanID, startTime;
bool bIsMythRecording = false;
bIsMythRecording = extractDetailsFromFilename(inFile, chanID, startTime);
if (bIsMythRecording)
{
uint chanid = chanID.toUInt();
QDateTime recstartts = MythDate::fromString(startTime);
pinfo = new ProgramInfo(chanid, recstartts);
if (pinfo->GetChanID())
{
pinfo->SetPathname(pinfo->GetPlaybackURL(false, true));
}
else
{
delete pinfo;
pinfo = NULL;
}
}
if (!pinfo)
{
// file is not a myth recording or is no longer in the db
pinfo = new ProgramInfo(inFile);
LOG(VB_JOBQUEUE, LOG_NOTICE, "File is not a MythTV recording.");
}
else
LOG(VB_JOBQUEUE, LOG_NOTICE, "File is a MythTV recording.");
return pinfo;
}
示例2: updateSelectedList
void RecordingSelector::updateSelectedList()
{
if (!m_recordingList)
return;
m_selectedList.clear();
ProgramInfo *p;
ArchiveItem *a;
for (int x = 0; x < m_archiveList->size(); x++)
{
a = m_archiveList->at(x);
for (uint y = 0; y < m_recordingList->size(); y++)
{
p = m_recordingList->at(y);
if (p->GetPlaybackURL(false, true) == a->filename)
{
if (m_selectedList.indexOf(p) == -1)
m_selectedList.append(p);
break;
}
qApp->processEvents();
}
}
}
示例3: getRecordingList
void RecordingSelector::getRecordingList(void)
{
ProgramInfo *p;
m_recordingList = RemoteGetRecordedList(true);
m_categories.clear();
if (m_recordingList && m_recordingList->size() > 0)
{
vector<ProgramInfo *>::iterator i = m_recordingList->begin();
for ( ; i != m_recordingList->end(); i++)
{
p = *i;
// we can't handle recordings that have to be streamed to us
if (p->GetPlaybackURL(false, true).startsWith("myth://"))
{
VERBOSE(VB_FILE,
QString("MythArchive cannot handle this file because it isn't available locally - %1")
.arg(p->GetPlaybackURL(false, true)));
i = m_recordingList->erase(i);
i--;
continue;
}
// ignore live tv and deleted recordings
if (p->GetRecordingGroup() == "LiveTV" ||
p->GetRecordingGroup() == "Deleted")
{
i = m_recordingList->erase(i);
i--;
continue;
}
if (m_categories.indexOf(p->GetTitle()) == -1)
m_categories.append(p->GetTitle());
}
}
}
示例4: preview_helper
int preview_helper(uint chanid, QDateTime starttime,
long long previewFrameNumber, long long previewSeconds,
const QSize &previewSize,
const QString &infile, const QString &outfile)
{
// Lower scheduling priority, to avoid problems with recordings.
if (setpriority(PRIO_PROCESS, 0, 9))
LOG(VB_GENERAL, LOG_ERR, "Setting priority failed." + ENO);
if (!chanid || !starttime.isValid())
ProgramInfo::QueryKeyFromPathname(infile, chanid, starttime);
ProgramInfo *pginfo = NULL;
if (chanid && starttime.isValid())
{
pginfo = new ProgramInfo(chanid, starttime);
if (!pginfo->GetChanID())
{
LOG(VB_GENERAL, LOG_ERR,
QString("Cannot locate recording made on '%1' at '%2'")
.arg(chanid).arg(starttime.toString(Qt::ISODate)));
delete pginfo;
return GENERIC_EXIT_NOT_OK;
}
pginfo->SetPathname(pginfo->GetPlaybackURL(false, true));
}
else if (!infile.isEmpty())
{
if (!QFileInfo(infile).isReadable())
{
LOG(VB_GENERAL, LOG_ERR,
QString("Cannot read this file '%1'").arg(infile));
return GENERIC_EXIT_NOT_OK;
}
pginfo = new ProgramInfo(
infile, ""/*plot*/, ""/*title*/, ""/*subtitle*/, ""/*director*/,
0/*season*/, 0/*episode*/, ""/*inetref*/, 120/*length_in_minutes*/,
1895/*year*/, ""/*id*/);
}
else
{
LOG(VB_GENERAL, LOG_ERR, "Cannot locate recording to preview");
return GENERIC_EXIT_NOT_OK;
}
PreviewGenerator *previewgen = new PreviewGenerator(
pginfo, QString(), PreviewGenerator::kLocal);
if (previewFrameNumber >= 0)
previewgen->SetPreviewTimeAsFrameNumber(previewFrameNumber);
if (previewSeconds >= 0)
previewgen->SetPreviewTimeAsSeconds(previewSeconds);
previewgen->SetOutputSize(previewSize);
previewgen->SetOutputFilename(outfile);
bool ok = previewgen->RunReal();
previewgen->deleteLater();
delete pginfo;
return (ok) ? GENERIC_EXIT_OK : GENERIC_EXIT_NOT_OK;
}
示例5: OKPressed
void RecordingSelector::OKPressed()
{
// loop though selected recordings and add them to the list
ProgramInfo *p;
ArchiveItem *a;
// remove any items that have been removed from the list
QList<ArchiveItem *> tempAList;
for (int x = 0; x < m_archiveList->size(); x++)
{
a = m_archiveList->at(x);
bool found = false;
for (int y = 0; y < m_selectedList.size(); y++)
{
p = m_selectedList.at(y);
if (a->type != "Recording" || a->filename == p->GetPlaybackURL(false, true))
{
found = true;
break;
}
}
if (!found)
tempAList.append(a);
}
for (int x = 0; x < tempAList.size(); x++)
m_archiveList->removeAll(tempAList.at(x));
// remove any items that are already in the list
QList<ProgramInfo *> tempSList;
for (int x = 0; x < m_selectedList.size(); x++)
{
p = m_selectedList.at(x);
for (int y = 0; y < m_archiveList->size(); y++)
{
a = m_archiveList->at(y);
if (a->filename == p->GetPlaybackURL(false, true))
{
tempSList.append(p);
break;
}
}
}
for (int x = 0; x < tempSList.size(); x++)
m_selectedList.removeAll(tempSList.at(x));
// add all that are left
for (int x = 0; x < m_selectedList.size(); x++)
{
p = m_selectedList.at(x);
a = new ArchiveItem;
a->type = "Recording";
a->title = p->GetTitle();
a->subtitle = p->GetSubtitle();
a->description = p->GetDescription();
a->startDate = p->GetScheduledStartTime().toString("dd MMM yy");
a->startTime = p->GetScheduledStartTime().toString("(hh:mm)");
a->size = p->GetFilesize();
a->filename = p->GetPlaybackURL(false, true);
a->hasCutlist = p->HasCutlist();
a->useCutlist = false;
a->duration = 0;
a->cutDuration = 0;
a->videoWidth = 0;
a->videoHeight = 0;
a->fileCodec = "";
a->videoCodec = "";
a->encoderProfile = NULL;
a->editedDetails = false;
m_archiveList->append(a);
}
emit haveResult(true);
Close();
}
示例6: main
//.........这里部分代码省略.........
return GENERIC_EXIT_INVALID_CMDLINE;
}
VERBOSE(VB_IMPORTANT, QString("Enabled verbose msgs: %1").arg(verboseString));
if (!MSqlQuery::testDBConnection())
{
printf("couldn't open db\n");
return GENERIC_EXIT_DB_ERROR;
}
ProgramInfo *pginfo = NULL;
if (isVideo)
{
// We want the absolute file path for the filemarkup table
QFileInfo inf(infile);
infile = inf.absoluteFilePath();
pginfo = new ProgramInfo(infile);
}
else if (!found_infile)
{
QDateTime recstartts = myth_dt_from_string(starttime);
pginfo = new ProgramInfo(chanid, recstartts);
if (!pginfo->GetChanID())
{
QString msg = QString("Couldn't find recording for chanid %1 @ %2")
.arg(chanid).arg(starttime);
cerr << msg.toLocal8Bit().constData() << endl;
delete pginfo;
return GENERIC_EXIT_NO_RECORDING_DATA;
}
infile = pginfo->GetPlaybackURL(false, true);
}
else
{
pginfo = new ProgramInfo(infile);
if (!pginfo->GetChanID())
{
VERBOSE(VB_IMPORTANT,
QString("Couldn't find a recording for filename '%1'")
.arg(infile));
delete pginfo;
pginfo = NULL;
}
}
if (infile.left(7) == "myth://" && (outfile.isNull() || outfile != "-"))
{
VERBOSE(VB_IMPORTANT, QString("Attempted to transcode %1. "
"Mythtranscode is currently unable to transcode remote "
"files.")
.arg(infile));
return GENERIC_EXIT_REMOTE_FILE;
}
if (outfile.isNull() && !build_index)
outfile = infile + ".tmp";
if (jobID >= 0)
JobQueue::ChangeJobStatus(jobID, JOB_RUNNING);
Transcode *transcode = new Transcode(pginfo);
if (!build_index)
示例7: RunCCExtract
static int RunCCExtract(const ProgramInfo &program_info)
{
QString filename = program_info.GetPlaybackURL();
if (filename.startsWith("myth://"))
{
QString msg =
QString("Only locally accessible files are supported (%1).")
.arg(program_info.GetPathname());
cerr << qPrintable(msg) << endl;
return GENERIC_EXIT_INVALID_CMDLINE;
}
if (!QFile::exists(filename))
{
cerr << qPrintable(
QString("Could not open input file (%1).").arg(filename)) << endl;
return GENERIC_EXIT_INVALID_CMDLINE;
}
RingBuffer *tmprbuf = RingBuffer::Create(filename, false);
if (!tmprbuf)
{
cerr << qPrintable(QString("Unable to create RingBuffer for %1")
.arg(filename)) << endl;
return GENERIC_EXIT_PERMISSIONS_ERROR;
}
if (program_info.GetRecordingEndTime() > MythDate::current())
{
cout << "Program will end @ "
<< qPrintable(program_info.GetRecordingEndTime(MythDate::ISODate))
<< endl;
tmprbuf->SetWaitForWrite();
}
PlayerFlags flags = (PlayerFlags)(kVideoIsNull | kAudioMuted |
kDecodeNoLoopFilter | kDecodeFewBlocks |
kDecodeLowRes | kDecodeSingleThreaded |
kDecodeNoDecode);
MythCCExtractorPlayer *ccp = new MythCCExtractorPlayer(flags, true, filename);
PlayerContext *ctx = new PlayerContext(kCCExtractorInUseID);
ctx->SetPlayingInfo(&program_info);
ctx->SetRingBuffer(tmprbuf);
ctx->SetPlayer(ccp);
ccp->SetPlayerInfo(NULL, NULL, ctx);
if (ccp->OpenFile() < 0)
{
cerr << "Failed to open " << qPrintable(filename) << endl;
return GENERIC_EXIT_NOT_OK;
}
if (!ccp->run())
{
cerr << "Failed to decode " << qPrintable(filename) << endl;
return GENERIC_EXIT_NOT_OK;
}
delete ctx;
return GENERIC_EXIT_OK;
}