本文整理汇总了C++中MetaData::album方法的典型用法代码示例。如果您正苦于以下问题:C++ MetaData::album方法的具体用法?C++ MetaData::album怎么用?C++ MetaData::album使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MetaData
的用法示例。
在下文中一共展示了MetaData::album方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toDBus
QVariantMap toDBus(const MetaData &md) const {
QVariantMap map;
map["mpris:trackid"] = QVariant::fromValue(QDBusObjectPath(dbusTrackId(md.mrl())));
map["mpris:length"] = 1000LL*(qint64)md.duration();
map["xesam:url"] = md.mrl().toString();
map["xesam:title"] = md.title().isEmpty() ? engine->mediaInfo()->name() : md.title();
if (!md.album().isEmpty())
map["xesam:album"] = md.album();
if (!md.artist().isEmpty())
map["xesam:artist"] = QStringList(md.artist());
if (!md.genre().isEmpty())
map["xesam:genre"] = QStringList(md.genre());
return map;
}
示例2: showMetadataEditor
void MainWindow::showMetadataEditor()
{
QPointer<MetadataEditor> editor(new MetadataEditor());
const QModelIndex currentIndex = m_ui->playlistView->currentIndex();
const MetaData metaData = Player::instance()->playlist()->track(currentIndex.row());
editor->setMetaData(metaData);
int result = editor->exec();
if (result == QDialog::Rejected) {
if (editor) {
editor->deleteLater();
}
return;
}
if (!editor) {
return;
}
const MetaData newMetaData = editor->metaData();
TagLib::FileRef f(newMetaData.fileName().toLocal8Bit().constData());
// // FileRef::isNull() is not enough sometimes. Let's check the tag() too...
if (f.isNull() || !f.tag()) {
return;
}
f.tag()->setTrack(newMetaData.trackNumber());
f.tag()->setArtist(newMetaData.artist().toLocal8Bit().constData());
f.tag()->setAlbum(newMetaData.album().toLocal8Bit().constData());
f.tag()->setTitle(newMetaData.title().toLocal8Bit().constData());
f.tag()->setYear(newMetaData.year());
f.tag()->setGenre(newMetaData.genre().toLocal8Bit().constData());
f.save();
Player::instance()->playlist()->setTrack(currentIndex.row(), newMetaData);
TaskManager::instance()->rebuildCollections(newMetaData.fileName());
delete editor;
}
示例3: tr
void
ShareDialog::setSong( const MetaData& metaData )
{
m_metaData = metaData;
ui.recommendTypeBox->setItemText( 0, tr( "Artist: %1" ).arg( metaData.artist() ) );
ui.recommendTypeBox->setItemText( 1, tr( "Track: %1 - %2" ).arg( metaData.artist() ).arg( metaData.track() ) );
if ( ui.recommendTypeBox->count() == 2 )
ui.recommendTypeBox->addItem( tr( "Album: %1 - %2" ).arg( metaData.artist() ).arg( metaData.album() ) );
else
ui.recommendTypeBox->setItemText( 2, tr( "Album: %1 - %2" ).arg( metaData.artist() ).arg( metaData.album() ) );
}