本文整理汇总了C++中Metadata::Station方法的典型用法代码示例。如果您正苦于以下问题:C++ Metadata::Station方法的具体用法?C++ Metadata::Station怎么用?C++ Metadata::Station使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Metadata
的用法示例。
在下文中一共展示了Metadata::Station方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeStream
void StreamView::removeStream(void)
{
MythUIButtonListItem *item = m_streamList->GetItemCurrent();
if (item)
{
Metadata *mdata = qVariantValue<Metadata*> (item->GetData());
ShowOkPopup(QString("Are you sure you want to delete this Stream?\n"
"Station:%1 - Channel: %2")
.arg(mdata->Station()).arg(mdata->Channel()),
this, SLOT(doRemoveStream(bool)), true);
}
}
示例2: updateStreams
void SearchStream::updateStreams(void)
{
m_streamList->Reset();
QString station = m_stationList->GetValue();
QString genre = m_genreList->GetValue();
QString channel = m_channelEdit->GetText();
bool searchStation = (station != tr("<All Stations>"));
bool searchGenre = (genre != tr("<All Genres>"));
bool searchChannel = !channel.isEmpty();
QMap<QString, Metadata>::iterator it;
for (it = m_streams.begin(); it != m_streams.end(); ++it)
{
Metadata *mdata = &(*it);
if (searchStation && station != mdata->Station())
continue;
if (searchGenre && !mdata->Genre().contains(genre, Qt::CaseInsensitive))
continue;
if (searchChannel && !mdata->Channel().contains(channel, Qt::CaseInsensitive))
continue;
// if we got here we must have a match so add it to the list
MythUIButtonListItem *item = new MythUIButtonListItem(m_streamList,
"", qVariantFromValue(mdata));
MetadataMap metadataMap;
mdata->toMap(metadataMap);
item->SetTextFromMap(metadataMap);
item->SetText(" ", "dummy");
}
m_matchesText->SetText(QString("%1").arg(m_streamList->GetCount()));
}
示例3: loadStreams
void SearchStream::loadStreams(void)
{
m_streams.clear();
m_stations.clear();
m_genres.clear();
m_stations.append(tr("<All Stations>"));
m_genres.append(tr("<All Genres>"));
QString filename = QString("%1%2").arg(GetShareDir()).arg("mythmusic/streams.xml");
QFile xmlFile(filename);
if (!xmlFile.exists() || !xmlFile.open(QIODevice::ReadOnly))
{
LOG(VB_GENERAL, LOG_ERR, "SearchStream: Cannot open streams.xml");
return;
}
QString errorMsg;
int errorLine = 0;
int errorColumn = 0;
QDomDocument domDoc;
if (!domDoc.setContent(&xmlFile, false, &errorMsg,
&errorLine, &errorColumn))
{
LOG(VB_GENERAL, LOG_ERR,
"SearchStream: Could not read content of streams.xml" +
QString("\n\t\t\tError parsing %1").arg(filename) +
QString("\n\t\t\tat line: %1 column: %2 msg: %3")
.arg(errorLine).arg(errorColumn).arg(errorMsg));
return;
}
QDomNodeList itemList = domDoc.elementsByTagName("item");
QDomNode itemNode;
for (int i = 0; i < itemList.count(); i++)
{
itemNode = itemList.item(i);
Metadata mdata;
mdata.setStation(itemNode.namedItem(QString("station")).toElement().text());
mdata.setChannel(itemNode.namedItem(QString("channel")).toElement().text());
mdata.setUrl(itemNode.namedItem(QString("url")).toElement().text());
mdata.setLogoUrl(itemNode.namedItem(QString("logourl")).toElement().text());
mdata.setGenre(itemNode.namedItem(QString("genre")).toElement().text());
mdata.setMetadataFormat(itemNode.namedItem(QString("metadataformat")).toElement().text());
m_streams.insert(mdata.Station() + '-' + mdata.Channel(), mdata);
if (!m_stations.contains(mdata.Station()))
m_stations.append(mdata.Station());
QStringList genreList = mdata.Genre().split(',');
for (int x = 0; x < genreList.count(); x++)
{
if (!m_genres.contains(genreList[x].trimmed()))
m_genres.append(genreList[x].trimmed());
}
}
xmlFile.close();
m_stations.sort();
m_genres.sort();
}