Пример #1
0
void CMusicInfoTagLoaderWMA::SetTagValueUnsigned(const CStdString& strFrameName, uint32_t value, CMusicInfoTag& tag)
{
  if (strFrameName == "WM/TrackNumber")
  {
    if (tag.GetTrackNumber() <= 0)
      tag.SetTrackNumber(value);
  }
}
Пример #2
0
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
0
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
0
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;
  //}
}