本文整理汇总了C++中MusicMetadata::setYear方法的典型用法代码示例。如果您正苦于以下问题:C++ MusicMetadata::setYear方法的具体用法?C++ MusicMetadata::setYear怎么用?C++ MusicMetadata::setYear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MusicMetadata
的用法示例。
在下文中一共展示了MusicMetadata::setYear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: yearChanged
void Ripper::yearChanged()
{
QString newyear = m_yearEdit->GetText();
if (m_tracks->size() > 0)
{
for (int trackno = 0; trackno < m_tracks->size(); ++trackno)
{
MusicMetadata *data = m_tracks->at(trackno)->metadata;
if (data)
data->setYear(newyear.toInt());
}
}
m_year = newyear;
}
示例2: UpdateMeta
static int UpdateMeta(const MythUtilCommandLineParser &cmdline)
{
bool ok = true;
int result = GENERIC_EXIT_OK;
if (cmdline.toString("songid").isEmpty())
{
LOG(VB_GENERAL, LOG_ERR, "Missing --songid option");
return GENERIC_EXIT_INVALID_CMDLINE;
}
int songID = cmdline.toInt("songid");
MusicMetadata *mdata = MusicMetadata::createFromID(songID);
if (!mdata)
{
LOG(VB_GENERAL, LOG_ERR, QString("Cannot find metadata for trackid: %1").arg(songID));
return GENERIC_EXIT_NOT_OK;
}
if (!cmdline.toString("title").isEmpty())
mdata->setTitle(cmdline.toString("title"));
if (!cmdline.toString("artist").isEmpty())
mdata->setArtist(cmdline.toString("artist"));
if (!cmdline.toString("album").isEmpty())
mdata->setAlbum(cmdline.toString("album"));
if (!cmdline.toString("genre").isEmpty())
mdata->setGenre(cmdline.toString("genre"));
if (!cmdline.toString("trackno").isEmpty())
mdata->setTrack(cmdline.toInt("trackno"));
if (!cmdline.toString("year").isEmpty())
mdata->setYear(cmdline.toInt("year"));
if (!cmdline.toString("rating").isEmpty())
mdata->setRating(cmdline.toInt("rating"));
if (!cmdline.toString("playcount").isEmpty())
mdata->setPlaycount(cmdline.toInt("playcount"));
if (!cmdline.toString("lastplayed").isEmpty())
mdata->setLastPlay(cmdline.toDateTime("lastplayed"));
mdata->dumpToDatabase();
MetaIO *tagger = mdata->getTagger();
if (tagger)
{
ok = tagger->write(mdata->getLocalFilename(), mdata);
if (!ok)
LOG(VB_GENERAL, LOG_ERR, QString("Failed to write to tag for trackid: %1").arg(songID));
}
// tell any clients that the metadata for this track has changed
gCoreContext->SendMessage(QString("MUSIC_METADATA_CHANGED %1").arg(songID));
if (!ok)
result = GENERIC_EXIT_NOT_OK;
return result;
}