本文整理汇总了C++中ArtworkMap::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ ArtworkMap::insert方法的具体用法?C++ ArtworkMap::insert怎么用?C++ ArtworkMap::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArtworkMap
的用法示例。
在下文中一共展示了ArtworkMap::insert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetArtwork
bool SetArtwork(const QString &inetref,
uint season,
const QString &host,
const QString &coverart,
const QString &fanart,
const QString &banner)
{
bool ret = false;
ArtworkMap map;
if (!coverart.isEmpty())
{
ArtworkInfo coverartinfo;
coverartinfo.url = generate_myth_url("Coverart", host, coverart);
map.insert(kArtworkCoverart, coverartinfo);
}
if (!fanart.isEmpty())
{
ArtworkInfo fanartinfo;
fanartinfo.url = generate_myth_url("Fanart", host, fanart);
map.insert(kArtworkFanart, fanartinfo);
}
if (!banner.isEmpty())
{
ArtworkInfo bannerinfo;
bannerinfo.url = generate_myth_url("Banners", host, banner);
map.insert(kArtworkBanner, bannerinfo);
}
ret = SetArtwork(inetref, season, host, map);
return ret;
}
示例2: GetArtwork
ArtworkMap GetArtwork(QString inetref,
uint season,
bool strict)
{
ArtworkMap map;
MSqlQuery query(MSqlQuery::InitCon());
QString querystring = "SELECT host, coverart, fanart, banner "
"FROM recordedartwork WHERE inetref = :INETREF ";
if (strict)
querystring += "AND season = :SEASON;";
else
querystring += "ORDER BY season = :SEASON DESC, season DESC;";
query.prepare(querystring);
query.bindValue(":INETREF", inetref);
query.bindValue(":SEASON", season);
if (!query.exec())
{
MythDB::DBError("GetArtwork SELECT", query);
return map;
}
if (query.next())
{
QString host = query.value(0).toString();
QString coverart = query.value(1).toString();
QString fanart = query.value(2).toString();
QString banner = query.value(3).toString();
if (!coverart.isEmpty())
{
ArtworkInfo coverartinfo;
coverartinfo.url = generate_myth_url("Coverart", host, coverart);
map.insert(kArtworkCoverart, coverartinfo);
}
if (!fanart.isEmpty())
{
ArtworkInfo fanartinfo;
fanartinfo.url = generate_myth_url("Fanart", host, fanart);
map.insert(kArtworkFanart, fanartinfo);
}
if (!banner.isEmpty())
{
ArtworkInfo bannerinfo;
bannerinfo.url = generate_myth_url("Banners", host, banner);
map.insert(kArtworkBanner, bannerinfo);
}
}
return map;
}
示例3: StartGameImageSet
void GameUI::StartGameImageSet(MythGenericTree *node, QStringList coverart,
QStringList fanart, QStringList screenshot)
{
if (!node)
return;
RomInfo *metadata = qVariantValue<RomInfo *>(node->GetData());
if (!metadata)
return;
ArtworkMap map;
QString inetref = metadata->Inetref();
QString system = metadata->System();
QString title = metadata->Gamename();
if (metadata->Boxart().isEmpty() && coverart.size())
{
ArtworkInfo info;
info.url = coverart.takeAt(0).trimmed();
map.insert(kArtworkCoverart, info);
}
if (metadata->Fanart().isEmpty() && fanart.size())
{
ArtworkInfo info;
info.url = fanart.takeAt(0).trimmed();
map.insert(kArtworkFanart, info);
}
if (metadata->Screenshot().isEmpty() && screenshot.size())
{
ArtworkInfo info;
info.url = screenshot.takeAt(0).trimmed();
map.insert(kArtworkScreenshot, info);
}
MetadataLookup *lookup = new MetadataLookup();
lookup->SetTitle(metadata->Gamename());
lookup->SetSystem(metadata->System());
lookup->SetInetref(metadata->Inetref());
lookup->SetType(kMetadataGame);
lookup->SetDownloads(map);
lookup->SetData(qVariantFromValue(node));
m_imageDownload->addDownloads(lookup);
}
示例4: OnSearchListSelection
void EditMetadataDialog::OnSearchListSelection(ArtworkInfo info, VideoArtworkType type)
{
QString msg = tr("Downloading selected artwork...");
createBusyDialog(msg);
MetadataLookup *lookup = new MetadataLookup();
lookup->SetType(kMetadataVideo);
if (m_workingMetadata->GetSeason() > 0 ||
m_workingMetadata->GetEpisode() > 0)
lookup->SetSubtype(kProbableTelevision);
else if (m_workingMetadata->GetSubtitle().isEmpty())
lookup->SetSubtype(kProbableMovie);
else
lookup->SetSubtype(kUnknownVideo);
lookup->SetHost(m_workingMetadata->GetHost());
lookup->SetAutomatic(true);
lookup->SetData(qVariantFromValue<VideoArtworkType>(type));
ArtworkMap downloads;
downloads.insert(type, info);
lookup->SetDownloads(downloads);
lookup->SetAllowOverwrites(true);
lookup->SetTitle(m_workingMetadata->GetTitle());
lookup->SetSubtitle(m_workingMetadata->GetSubtitle());
lookup->SetSeason(m_workingMetadata->GetSeason());
lookup->SetEpisode(m_workingMetadata->GetEpisode());
lookup->SetInetref(m_workingMetadata->GetInetRef());
m_imageDownload->addDownloads(lookup);
}
示例5: ParseArtwork
ArtworkMap ParseArtwork(QDomElement artwork)
{
ArtworkMap ret;
QDomElement image = artwork.firstChildElement("image");
if (!image.isNull())
{
while (!image.isNull())
{
if (image.hasAttribute("type"))
{
QString typestring = image.attribute("type");
VideoArtworkType type;
if (typestring.toLower() == "coverart")
type = kArtworkCoverart;
else if (typestring.toLower() == "fanart")
type = kArtworkFanart;
else if (typestring.toLower() == "banner")
type = kArtworkBanner;
else if (typestring.toLower() == "screenshot")
type = kArtworkScreenshot;
else if (typestring.toLower() == "poster")
type = kArtworkPoster;
else if (typestring.toLower() == "back cover")
type = kArtworkBackCover;
else if (typestring.toLower() == "inside cover")
type = kArtworkInsideCover;
else if (typestring.toLower() == "cd image")
type = kArtworkCDImage;
else
type = kArtworkCoverart;
ArtworkInfo info;
if (image.hasAttribute("thumb"))
info.thumbnail = image.attribute("thumb");
if (image.hasAttribute("url"))
info.url = image.attribute("url");
if (image.hasAttribute("width"))
info.width = image.attribute("width").toUInt();
else
info.width = 0;
if (image.hasAttribute("height"))
info.height = image.attribute("height").toUInt();
else
info.height = 0;
ret.insert(type,info);
}
image = image.nextSiblingElement("image");
}
}
return ret;
}