本文整理汇总了C++中MetadataLookupList::at方法的典型用法代码示例。如果您正苦于以下问题:C++ MetadataLookupList::at方法的具体用法?C++ MetadataLookupList::at怎么用?C++ MetadataLookupList::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MetadataLookupList
的用法示例。
在下文中一共展示了MetadataLookupList::at方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleRecordingGeneric
MetadataLookupList MetadataDownload::handleRecordingGeneric(
MetadataLookup* lookup)
{
// We only enter this mode if we are pretty darn sure this is a TV show,
// but we're for some reason looking up a generic, or the title didn't
// exactly match in one of the earlier lookups. This is a total
// hail mary to try to get at least *series* level info and art/inetref.
MetadataLookupList list;
QString cmd = GetTelevisionGrabber();
QStringList args;
args.append(QString("-l")); // Language Flag
args.append(gCoreContext->GetLanguage()); // UI Language
args.append(QString("-a"));
args.append(gCoreContext->GetLocale()->GetCountryCode());
args.append("-M");
QString title = lookup->GetTitle();
args.append(title);
LookupType origtype = lookup->GetSubtype();
int origseason = lookup->GetSeason();
int origepisode = lookup->GetEpisode();
lookup->SetSubtype(kProbableGenericTelevision);
if (origseason == 0 && origepisode == 0)
{
lookup->SetSeason(1);
lookup->SetEpisode(1);
}
list = runGrabber(cmd, args, lookup, true);
if (list.count() == 1)
{
lookup->SetInetref(list.at(0)->GetInetref());
lookup->SetCollectionref(list.at(0)->GetCollectionref());
list = handleTelevision(lookup);
}
lookup->SetSeason(origseason);
lookup->SetEpisode(origepisode);
lookup->SetSubtype(origtype);
return list;
}
示例2: handleVideoUndetermined
MetadataLookupList MetadataDownload::handleVideoUndetermined(
MetadataLookup* lookup)
{
MetadataLookupList list;
QString cmd = GetTelevisionGrabber();
// Can't trust the inetref with so little information.
QStringList args;
args.append(QString("-l")); // Language Flag
args.append(gCoreContext->GetLanguage()); // UI Language
args.append(QString("-N"));
if (!lookup->GetInetref().isEmpty())
{
QString inetref = lookup->GetInetref();
args.append(inetref);
}
else
{
QString title = lookup->GetTitle();
args.append(title);
}
QString subtitle = lookup->GetSubtitle();
args.append(subtitle);
// Try to do a title/subtitle lookup
list = runGrabber(cmd, args, lookup, false);
if (list.count() == 1)
list.at(0)->SetStep(kLookupData);
return list;
}
示例3: handleRecordingGeneric
MetadataLookupList MetadataDownload::handleRecordingGeneric(
MetadataLookup* lookup)
{
// We only enter this mode if we are pretty darn sure this is a TV show,
// but we're for some reason looking up a generic, or the title didn't
// exactly match in one of the earlier lookups. This is a total
// hail mary to try to get at least *series* level info and art/inetref.
MetadataLookupList list;
QString def_cmd = QDir::cleanPath(QString("%1/%2")
.arg(GetShareDir())
.arg("metadata/Television/ttvdb.py"));
QString cmd = gCoreContext->GetSetting("TelevisionGrabber", def_cmd);
QStringList args;
args.append(QString("-l")); // Language Flag
args.append(gCoreContext->GetLanguage()); // UI Language
args.append("-M");
QString title = lookup->GetTitle();
args.append(title);
lookup->SetSubtype(kProbableGenericTelevision);
int origseason = lookup->GetSeason();
int origepisode = lookup->GetEpisode();
if (origseason == 0 && origepisode == 0)
{
lookup->SetSeason(1);
lookup->SetEpisode(1);
}
list = runGrabber(cmd, args, lookup, true);
if (list.count() == 1)
list.at(0)->SetStep(kLookupData);
lookup->SetSeason(origseason);
lookup->SetEpisode(origepisode);
return list;
}
示例4: run
void MetadataDownload::run()
{
RunProlog();
MetadataLookup* lookup;
while ((lookup = moreWork()) != NULL)
{
MetadataLookupList list;
// Go go gadget Metadata Lookup
if (lookup->GetType() == kMetadataVideo)
{
if (lookup->GetSubtype() == kProbableTelevision)
list = handleTelevision(lookup);
else if (lookup->GetSubtype() == kProbableMovie)
list = handleMovie(lookup);
else
list = handleVideoUndetermined(lookup);
if (!list.size() &&
lookup->GetSubtype() == kUnknownVideo)
{
list = handleMovie(lookup);
}
}
else if (lookup->GetType() == kMetadataRecording)
{
if (lookup->GetSubtype() == kProbableTelevision)
{
if (lookup->GetSeason() > 0 || lookup->GetEpisode() > 0)
list = handleTelevision(lookup);
else if (!lookup->GetSubtitle().isEmpty())
list = handleVideoUndetermined(lookup);
if (!list.size())
list = handleRecordingGeneric(lookup);
}
else if (lookup->GetSubtype() == kProbableMovie)
{
list = handleMovie(lookup);
if (lookup->GetInetref().isEmpty())
list.append(handleRecordingGeneric(lookup));
}
else
{
list = handleRecordingGeneric(lookup);
if (lookup->GetInetref().isEmpty())
list.append(handleMovie(lookup));
}
}
else if (lookup->GetType() == kMetadataGame)
list = handleGame(lookup);
// inform parent we have lookup ready for it
if (m_parent && list.count() >= 1)
{
// If there's only one result, don't bother asking
// our parent about it, just add it to the back of
// the queue in kLookupData mode.
if (list.count() == 1 && list.at(0)->GetStep() == kLookupSearch)
{
MetadataLookup *newlookup = list.takeFirst();
newlookup->SetStep(kLookupData);
prependLookup(newlookup);
continue;
}
// If we're in automatic mode, we need to make
// these decisions on our own. Pass to title match.
if (list.at(0)->GetAutomatic() && list.count() > 1)
{
if (!findBestMatch(list, lookup->GetTitle()))
QCoreApplication::postEvent(m_parent,
new MetadataLookupFailure(MetadataLookupList() << lookup));
continue;
}
LOG(VB_GENERAL, LOG_INFO,
QString("Returning Metadata Results: %1 %2 %3")
.arg(lookup->GetTitle()).arg(lookup->GetSeason())
.arg(lookup->GetEpisode()));
QCoreApplication::postEvent(m_parent,
new MetadataLookupEvent(list));
}
else
{
list.append(lookup);
QCoreApplication::postEvent(m_parent,
new MetadataLookupFailure(list));
}
}
RunEpilog();
}