本文整理汇总了C++中ProgramInfo::GetSubtitle方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramInfo::GetSubtitle方法的具体用法?C++ ProgramInfo::GetSubtitle怎么用?C++ ProgramInfo::GetSubtitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramInfo
的用法示例。
在下文中一共展示了ProgramInfo::GetSubtitle方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleAllRecordings
void LookerUpper::HandleAllRecordings()
{
QMap< QString, ProgramInfo* > recMap;
QMap< QString, uint32_t > inUseMap = ProgramInfo::QueryInUseMap();
QMap< QString, bool > isJobRunning = ProgramInfo::QueryJobsRunning(JOB_COMMFLAG);
ProgramList progList;
LoadFromRecorded( progList, false, inUseMap, isJobRunning, recMap, -1 );
for( int n = 0; n < (int)progList.size(); n++)
{
ProgramInfo *pginfo = new ProgramInfo(*(progList[n]));
if (pginfo->GetInetRef().isEmpty() ||
(!pginfo->GetSubtitle().isEmpty() &&
(pginfo->GetSeason() == 0) &&
(pginfo->GetEpisode() == 0)))
{
QString msg = QString("Looking up: %1 %2").arg(pginfo->GetTitle())
.arg(pginfo->GetSubtitle());
VERBOSE(VB_IMPORTANT, msg);
m_busyRecList.append(pginfo);
m_metadataFactory->Lookup(pginfo, false, false);
}
}
}
示例2: HandleAllRecordings
void LookerUpper::HandleAllRecordings(bool updaterules)
{
QMap< QString, ProgramInfo* > recMap;
QMap< QString, uint32_t > inUseMap = ProgramInfo::QueryInUseMap();
QMap< QString, bool > isJobRunning = ProgramInfo::QueryJobsRunning(JOB_COMMFLAG);
m_updaterules = updaterules;
ProgramList progList;
LoadFromRecorded( progList, false, inUseMap, isJobRunning, recMap, -1 );
for( int n = 0; n < (int)progList.size(); n++)
{
ProgramInfo *pginfo = new ProgramInfo(*(progList[n]));
if ((pginfo->GetRecordingGroup() != "Deleted") &&
(pginfo->GetRecordingGroup() != "LiveTV") &&
(pginfo->GetInetRef().isEmpty() ||
(!pginfo->GetSubtitle().isEmpty() &&
(pginfo->GetSeason() == 0) &&
(pginfo->GetEpisode() == 0))))
{
QString msg = QString("Looking up: %1 %2").arg(pginfo->GetTitle())
.arg(pginfo->GetSubtitle());
LOG(VB_GENERAL, LOG_INFO, msg);
m_busyRecList.append(pginfo);
m_metadataFactory->Lookup(pginfo, true, false, false);
}
else
delete pginfo;
}
}
示例3: CopyRuleInetrefsToRecordings
void LookerUpper::CopyRuleInetrefsToRecordings()
{
QMap< QString, ProgramInfo* > recMap;
QMap< QString, uint32_t > inUseMap = ProgramInfo::QueryInUseMap();
QMap< QString, bool > isJobRunning = ProgramInfo::QueryJobsRunning(JOB_COMMFLAG);
ProgramList progList;
LoadFromRecorded( progList, false, inUseMap, isJobRunning, recMap, -1 );
for( int n = 0; n < (int)progList.size(); n++)
{
ProgramInfo *pginfo = new ProgramInfo(*(progList[n]));
if (pginfo && pginfo->GetInetRef().isEmpty())
{
RecordingRule *rule = new RecordingRule();
rule->m_recordID = pginfo->GetRecordingRuleID();
rule->Load();
if (!rule->m_inetref.isEmpty())
{
QString msg = QString("%1").arg(pginfo->GetTitle());
if (!pginfo->GetSubtitle().isEmpty())
msg += QString(": %1").arg(pginfo->GetSubtitle());
msg += " has no inetref, but its recording rule does. Copying...";
LOG(VB_GENERAL, LOG_INFO, msg);
pginfo->SaveInetRef(rule->m_inetref);
}
delete rule;
}
delete pginfo;
}
}
示例4: titleChanged
void RecordingSelector::titleChanged(MythUIButtonListItem *item)
{
ProgramInfo *p;
p = qVariantValue<ProgramInfo *>(item->GetData());
if (!p)
return;
if (m_titleText)
m_titleText->SetText(p->GetTitle());
if (m_datetimeText)
m_datetimeText->SetText(p->GetScheduledStartTime()
.toString("dd MMM yy (hh:mm)"));
if (m_descriptionText)
{
m_descriptionText->SetText(
((!p->GetSubtitle().isEmpty()) ? p->GetSubtitle() + "\n" : "") +
p->GetDescription());
}
if (m_filesizeText)
{
m_filesizeText->SetText(formatSize(p->GetFilesize() / 1024));
}
if (m_cutlistImage)
{
if (p->HasCutlist())
m_cutlistImage->Show();
else
m_cutlistImage->Hide();
}
if (m_previewImage)
{
// try to locate a preview image
if (QFile::exists(p->GetPathname() + ".png"))
{
m_previewImage->SetFilename(p->GetPathname() + ".png");
m_previewImage->Load();
}
else
{
m_previewImage->SetFilename("blank.png");
m_previewImage->Load();
}
}
}
示例5: HandleAllRecordingRules
void LookerUpper::HandleAllRecordingRules()
{
m_updaterules = true;
vector<ProgramInfo *> recordingList;
RemoteGetAllScheduledRecordings(recordingList);
for( int n = 0; n < (int)recordingList.size(); n++)
{
ProgramInfo *pginfo = new ProgramInfo(*(recordingList[n]));
if (pginfo->GetInetRef().isEmpty())
{
QString msg = QString("Looking up: %1 %2").arg(pginfo->GetTitle())
.arg(pginfo->GetSubtitle());
LOG(VB_GENERAL, LOG_INFO, msg);
m_busyRecList.append(pginfo);
m_metadataFactory->Lookup(pginfo, false, false);
}
}
}
示例6: customEvent
void LookerUpper::customEvent(QEvent *levent)
{
if (levent->type() == MetadataFactoryMultiResult::kEventType)
{
MetadataFactoryMultiResult *mfmr = dynamic_cast<MetadataFactoryMultiResult*>(levent);
if (!mfmr)
return;
MetadataLookupList list = mfmr->results;
if (list.count() > 1)
{
int yearindex = -1;
for (int p = 0; p != list.size(); ++p)
{
ProgramInfo *pginfo = list[p]->GetData().value<ProgramInfo *>();
if (pginfo && !pginfo->GetSeriesID().isEmpty() &&
pginfo->GetSeriesID() == (list[p])->GetTMSref())
{
MetadataLookup *lookup = list[p];
if (lookup->GetSubtype() != kProbableGenericTelevision)
pginfo->SaveSeasonEpisode(lookup->GetSeason(), lookup->GetEpisode());
pginfo->SaveInetRef(lookup->GetInetref());
m_busyRecList.removeAll(pginfo);
return;
}
else if (pginfo && pginfo->GetYearOfInitialRelease() != 0 &&
(list[p])->GetYear() != 0 &&
pginfo->GetYearOfInitialRelease() == (list[p])->GetYear())
{
if (yearindex != -1)
{
LOG(VB_GENERAL, LOG_INFO, "Multiple results matched on year. No definite "
"match could be found.");
m_busyRecList.removeAll(pginfo);
return;
}
else
{
LOG(VB_GENERAL, LOG_INFO, "Matched from multiple results based on year. ");
yearindex = p;
}
}
}
if (yearindex > -1)
{
MetadataLookup *lookup = list[yearindex];
ProgramInfo *pginfo = lookup->GetData().value<ProgramInfo *>();
if (lookup->GetSubtype() != kProbableGenericTelevision)
pginfo->SaveSeasonEpisode(lookup->GetSeason(), lookup->GetEpisode());
pginfo->SaveInetRef(lookup->GetInetref());
m_busyRecList.removeAll(pginfo);
return;
}
LOG(VB_GENERAL, LOG_INFO, "Unable to match this title, too many possible matches. "
"You may wish to manually set the season, episode, and "
"inetref in the 'Watch Recordings' screen.");
ProgramInfo *pginfo = list[0]->GetData().value<ProgramInfo *>();
if (pginfo)
{
m_busyRecList.removeAll(pginfo);
}
}
}
else if (levent->type() == MetadataFactorySingleResult::kEventType)
{
MetadataFactorySingleResult *mfsr =
dynamic_cast<MetadataFactorySingleResult*>(levent);
if (!mfsr)
return;
MetadataLookup *lookup = mfsr->result;
if (!lookup)
return;
ProgramInfo *pginfo = lookup->GetData().value<ProgramInfo *>();
// This null check could hang us as this pginfo would then never be
// removed
if (!pginfo)
return;
LOG(VB_GENERAL, LOG_DEBUG, "I found the following data:");
LOG(VB_GENERAL, LOG_DEBUG,
QString(" Input Title: %1").arg(pginfo->GetTitle()));
LOG(VB_GENERAL, LOG_DEBUG,
QString(" Input Sub: %1").arg(pginfo->GetSubtitle()));
LOG(VB_GENERAL, LOG_DEBUG,
QString(" Title: %1").arg(lookup->GetTitle()));
LOG(VB_GENERAL, LOG_DEBUG,
QString(" Subtitle: %1").arg(lookup->GetSubtitle()));
//.........这里部分代码省略.........
示例7: HandleAllArtwork
void LookerUpper::HandleAllArtwork(bool aggressive)
{
m_updateartwork = true;
if (aggressive)
m_updaterules = true;
// First, handle all recording rules w/ inetrefs
vector<ProgramInfo *> recordingList;
RemoteGetAllScheduledRecordings(recordingList);
int maxartnum = 3;
for( int n = 0; n < (int)recordingList.size(); n++)
{
ProgramInfo *pginfo = new ProgramInfo(*(recordingList[n]));
bool dolookup = true;
if (pginfo->GetInetRef().isEmpty())
dolookup = false;
if (dolookup || aggressive)
{
ArtworkMap map = GetArtwork(pginfo->GetInetRef(), pginfo->GetSeason(), true);
if (map.isEmpty() || (aggressive && map.count() < maxartnum))
{
QString msg = QString("Looking up artwork for recording rule: %1 %2")
.arg(pginfo->GetTitle())
.arg(pginfo->GetSubtitle());
LOG(VB_GENERAL, LOG_INFO, msg);
m_busyRecList.append(pginfo);
m_metadataFactory->Lookup(pginfo, true, true, true);
continue;
}
}
delete pginfo;
}
// Now, Attempt to fill in the gaps for recordings
QMap< QString, ProgramInfo* > recMap;
QMap< QString, uint32_t > inUseMap = ProgramInfo::QueryInUseMap();
QMap< QString, bool > isJobRunning = ProgramInfo::QueryJobsRunning(JOB_COMMFLAG);
ProgramList progList;
LoadFromRecorded( progList, false, inUseMap, isJobRunning, recMap, -1 );
for( int n = 0; n < (int)progList.size(); n++)
{
ProgramInfo *pginfo = new ProgramInfo(*(progList[n]));
bool dolookup = true;
LookupType type = GuessLookupType(pginfo);
if (type == kProbableMovie)
maxartnum = 2;
if ((!aggressive && type == kProbableGenericTelevision) ||
pginfo->GetRecordingGroup() == "Deleted" ||
pginfo->GetRecordingGroup() == "LiveTV")
dolookup = false;
if (dolookup || aggressive)
{
ArtworkMap map = GetArtwork(pginfo->GetInetRef(), pginfo->GetSeason(), true);
if (map.isEmpty() || (aggressive && map.count() < maxartnum))
{
QString msg = QString("Looking up artwork for recording: %1 %2")
.arg(pginfo->GetTitle())
.arg(pginfo->GetSubtitle());
LOG(VB_GENERAL, LOG_INFO, msg);
m_busyRecList.append(pginfo);
m_metadataFactory->Lookup(pginfo, true, true, aggressive);
continue;
}
}
delete pginfo;
}
}
示例8: 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();
}
示例9: customEvent
void LookerUpper::customEvent(QEvent *levent)
{
if (levent->type() == MetadataFactoryMultiResult::kEventType)
{
VERBOSE(VB_IMPORTANT, "Got a multiresult.");
// We shouldn't get any of these. If we do, metadataFactory->Lookup
// was called with the wrong arguments.
}
else if (levent->type() == MetadataFactorySingleResult::kEventType)
{
MetadataFactorySingleResult *mfsr = dynamic_cast<MetadataFactorySingleResult*>(levent);
if (!mfsr)
return;
MetadataLookup *lookup = mfsr->result;
if (!lookup)
return;
ProgramInfo *pginfo = qVariantValue<ProgramInfo *>(lookup->GetData());
// This null check could hang us as this pginfo would then never be removed
if (!pginfo)
return;
VERBOSE(VB_GENERAL|VB_EXTRA, QString("I found the following data:"));
VERBOSE(VB_GENERAL|VB_EXTRA, QString(" Input Title: %1").arg(pginfo->GetTitle()));
VERBOSE(VB_GENERAL|VB_EXTRA, QString(" Input Sub: %1").arg(pginfo->GetSubtitle()));
VERBOSE(VB_GENERAL|VB_EXTRA, QString(" Title: %1").arg(lookup->GetTitle()));
VERBOSE(VB_GENERAL|VB_EXTRA, QString(" Subtitle: %1").arg(lookup->GetSubtitle()));
VERBOSE(VB_GENERAL|VB_EXTRA, QString(" Season: %1").arg(lookup->GetSeason()));
VERBOSE(VB_GENERAL|VB_EXTRA, QString(" Episode: %1").arg(lookup->GetEpisode()));
VERBOSE(VB_GENERAL|VB_EXTRA, QString(" Inetref: %1").arg(lookup->GetInetref()));
VERBOSE(VB_GENERAL|VB_EXTRA, QString(" User Rating: %1").arg(lookup->GetUserRating()));
pginfo->SaveSeasonEpisode(lookup->GetSeason(), lookup->GetEpisode());
pginfo->SaveInetRef(lookup->GetInetref());
m_busyRecList.removeAll(pginfo);
}
else if (levent->type() == MetadataFactoryNoResult::kEventType)
{
MetadataFactoryNoResult *mfnr = dynamic_cast<MetadataFactoryNoResult*>(levent);
if (!mfnr)
return;
MetadataLookup *lookup = mfnr->result;
if (!lookup)
return;
ProgramInfo *pginfo = qVariantValue<ProgramInfo *>(lookup->GetData());
// This null check could hang us as this pginfo would then never be removed
if (!pginfo)
return;
m_busyRecList.removeAll(pginfo);
}
}
示例10: FillItemList
//.........这里部分代码省略.........
else if (m_type == plStoredSearch) // stored search
{
MSqlQuery query(MSqlQuery::InitCon());
query.prepare("SELECT fromclause, whereclause FROM customexample "
"WHERE rulename = :RULENAME;");
query.bindValue(":RULENAME", qphrase);
if (query.exec() && query.next())
{
QString fromc = query.value(0).toString();
QString wherec = query.value(1).toString();
where = QString("WHERE channel.visible = 1 "
" AND program.endtime > :PGILSTART "
" AND ( %1 ) ").arg(wherec);
if (!fromc.isEmpty())
where = fromc + ' ' + where;
}
}
else if (m_type == plPreviouslyRecorded)
{
if (m_recid && !m_title.isEmpty())
{
where = QString("WHERE recordid = %1 OR title = :MTITLE ")
.arg(m_recid);
bindings[":MTITLE"] = m_title;
}
else if (!m_title.isEmpty())
{
where = QString("WHERE title = :MTITLE ");
bindings[":MTITLE"] = m_title;
}
else if (m_recid)
{
where = QString("WHERE recordid = %1 ").arg(m_recid);
}
}
ProgramInfo selected;
const ProgramInfo *selectedP = (restorePosition) ? GetCurrent() : NULL;
if (selectedP)
{
selected = *selectedP;
selectedP = &selected;
}
int selectedOffset =
m_progList->GetCurrentPos() - m_progList->GetTopItemPos();
m_progList->Reset();
m_itemList.clear();
if (m_type == plPreviouslyRecorded)
{
LoadFromOldRecorded(m_itemList, where, bindings);
}
else
{
LoadFromScheduler(m_schedList);
LoadFromProgram(m_itemList, where, bindings, m_schedList, oneChanid);
}
const QRegExp prefixes(
tr("^(The |A |An )",
"Regular Expression for what to ignore when sorting"));
for (uint i = 0; i < m_itemList.size(); i++)
{
ProgramInfo *s = m_itemList[i];
s->sortTitle = (m_type == plTitle) ? s->GetSubtitle() : s->GetTitle();
s->sortTitle.remove(prefixes);
}
if (m_type == plNewListings || m_titleSort)
{
SortList(kTitleSort, m_reverseSort);
if (m_type != plPreviouslyRecorded)
{
// Prune to one per title
QString curtitle;
ProgramList::iterator it = m_itemList.begin();
while (it != m_itemList.end())
{
if ((*it)->sortTitle != curtitle)
{
curtitle = (*it)->sortTitle;
++it;
}
else
{
it = m_itemList.erase(it);
}
}
}
}
if (!m_titleSort)
SortList(GetSortBy(), m_reverseSort);
if (updateDisp)
UpdateDisplay(selectedP, selectedOffset);
}
示例11: updateRecordingList
void RecordingSelector::updateRecordingList(void)
{
if (!m_recordingList || m_recordingList->empty())
return;
m_recordingButtonList->Reset();
if (m_categorySelector)
{
ProgramInfo *p;
vector<ProgramInfo *>::iterator i = m_recordingList->begin();
for ( ; i != m_recordingList->end(); ++i)
{
p = *i;
if (p->GetTitle() == m_categorySelector->GetValue() ||
m_categorySelector->GetValue() == tr("All Recordings"))
{
MythUIButtonListItem* item = new MythUIButtonListItem(
m_recordingButtonList,
p->GetTitle() + " ~ " +
p->GetScheduledStartTime().toLocalTime()
.toString("dd MMM yy (hh:mm)"));
item->setCheckable(true);
if (m_selectedList.indexOf((ProgramInfo *) p) != -1)
{
item->setChecked(MythUIButtonListItem::FullChecked);
}
else
{
item->setChecked(MythUIButtonListItem::NotChecked);
}
QString title = p->GetTitle();
QString subtitle = p->GetSubtitle();
QDateTime recstartts = p->GetScheduledStartTime();
QDateTime recendts = p->GetScheduledEndTime();
QString timedate = QString("%1 - %2")
.arg(MythDate::toString(recstartts,MythDate::kDateTimeFull))
.arg(MythDate::toString(recendts, MythDate::kTime));
uint season = p->GetSeason();
uint episode = p->GetEpisode();
QString seasone, seasonx;
if (season && episode)
{
seasone = QString("s%1e%2")
.arg(format_season_and_episode(season, 2))
.arg(format_season_and_episode(episode, 2));
seasonx = QString("%1x%2")
.arg(format_season_and_episode(season, 1))
.arg(format_season_and_episode(episode, 2));
}
item->SetText(title, "title");
item->SetText(subtitle, "subtitle");
if (subtitle.isEmpty())
item->SetText(title, "titlesubtitle");
else
item->SetText(title + " - \"" + subtitle + '"',
"titlesubtitle");
item->SetText(timedate, "timedate");
item->SetText(p->GetDescription(), "description");
item->SetText(formatSize(p->GetFilesize() / 1024),
"filesize_str");
item->SetText(QString::number(season), "season");
item->SetText(QString::number(episode), "episode");
item->SetText(seasonx, "00x00");
item->SetText(seasone, "s00e00");
item->DisplayState(p->HasCutlist() ? "yes" : "no", "cutlist");
item->SetData(qVariantFromValue(p));
}
qApp->processEvents();
}
}
m_recordingButtonList->SetItemCurrent(m_recordingButtonList->GetItemFirst());
titleChanged(m_recordingButtonList->GetItemCurrent());
}