本文整理汇总了C++中CMusicInfoTag::GetTrackNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ CMusicInfoTag::GetTrackNumber方法的具体用法?C++ CMusicInfoTag::GetTrackNumber怎么用?C++ CMusicInfoTag::GetTrackNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMusicInfoTag
的用法示例。
在下文中一共展示了CMusicInfoTag::GetTrackNumber方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetTagValueUnsigned
void CMusicInfoTagLoaderWMA::SetTagValueUnsigned(const CStdString& strFrameName, uint32_t value, CMusicInfoTag& tag)
{
if (strFrameName == "WM/TrackNumber")
{
if (tag.GetTrackNumber() <= 0)
tag.SetTrackNumber(value);
}
}
示例2:
TYPED_TEST(TestTagParser, ParsesBasicTag) {
// Create a basic tag
TypeParam *tg = &this->value_;
CMusicInfoTag tag;
EXPECT_TRUE(CTagLoaderTagLib::ParseTag<TypeParam>(tg, NULL, tag));
EXPECT_EQ(1985, tag.GetYear());
EXPECT_EQ(2, tag.GetTrackNumber());
EXPECT_EQ(1u, tag.GetArtist().size());
if (tag.GetArtist().size() > 0) EXPECT_EQ("artist", tag.GetArtist().front());
EXPECT_EQ("album", tag.GetAlbum());
EXPECT_EQ("comment", tag.GetComment());
EXPECT_EQ(1u, tag.GetGenre().size());
if (tag.GetGenre().size() > 0) EXPECT_EQ("Jazz", tag.GetGenre().front());
EXPECT_EQ("title", tag.GetTitle());
}
示例3: end
TYPED_TEST(TestTagParser, FooProperties) {
TypeParam *tg = &this->value_;
CMusicInfoTag tag;
PropertyMap props;
int tagcount = end(tags) - tags;
for(int i = 0; i < tagcount; i++) {
props.insert(tags[i], String("foo"));
}
tg->setProperties(props);
EXPECT_TRUE(CTagLoaderTagLib::ParseTag<TypeParam>(tg, NULL, tag));
EXPECT_EQ(0, tag.GetYear());
EXPECT_EQ(0, tag.GetTrackNumber());
EXPECT_EQ(1u, tag.GetArtist().size());
if (tag.GetArtist().size() > 0) EXPECT_EQ("foo", tag.GetArtist().front());
EXPECT_EQ("foo", tag.GetAlbum());
EXPECT_EQ("foo", tag.GetComment());
if (tag.GetGenre().size() > 0) EXPECT_EQ("foo", tag.GetGenre().front());
EXPECT_EQ("foo", tag.GetTitle());
}
示例4: SetTagValueString
void CMusicInfoTagLoaderWMA::SetTagValueString(const CStdString& strFrameName, const CStdString& strValue, CMusicInfoTag& tag)
{
if (strFrameName == "WM/AlbumTitle")
{
tag.SetAlbum(strValue);
}
else if (strFrameName == "WM/AlbumArtist")
{
if (tag.GetAlbumArtist().IsEmpty()) tag.SetAlbumArtist(strValue);
}
else if (strFrameName == "Author")
{
// Multiple artists are stored in multiple "Author" tags we have get them
// separatly and merge them to our system
if (tag.GetArtist().IsEmpty())
tag.SetArtist(strValue);
else
tag.SetArtist(tag.GetArtist() + g_advancedSettings.m_musicItemSeparator + strValue);
}
else if (strFrameName == "WM/TrackNumber")
{
if (tag.GetTrackNumber() <= 0) tag.SetTrackNumber(atoi(strValue.c_str()));
}
else if (strFrameName == "WM/PartOfSet")
{
tag.SetPartOfSet(atoi(strValue.c_str()));
}
//else if (strFrameName=="WM/Track") // Old Tracknumber, should not be used anymore
else if (strFrameName == "WM/Year")
{
SYSTEMTIME dateTime;
dateTime.wYear = atoi(strValue.c_str());
tag.SetReleaseDate(dateTime);
}
else if (strFrameName == "WM/Genre")
{
// Multiple genres are stared in multiple "WM/Genre" tags we have to get them
// separatly and merge them to our system
if (tag.GetGenre().IsEmpty())
tag.SetGenre(strValue);
else
tag.SetGenre(tag.GetGenre() + g_advancedSettings.m_musicItemSeparator + strValue);
}
else if (strFrameName == "WM/Lyrics")
{
tag.SetLyrics(strValue);
}
//else if (strFrameName=="WM/DRM")
//{
// // File is DRM protected
// pwszValue;
//}
//else if (strFrameName=="WM/Codec")
//{
// pwszValue;
//}
//else if (strFrameName=="WM/BeatsPerMinute")
//{
// pwszValue;
//}
//else if (strFrameName=="WM/Mood")
//{
// pwszValue;
//}
//else if (strFrameName=="WM/RadioStationName")
//{
// pwszValue;
//}
//else if (strFrameName=="WM/RadioStationOwner")
//{
// pwszValue;
//}
}