本文整理汇总了C++中CMusicInfoTag::GetMusicBrainzTrackID方法的典型用法代码示例。如果您正苦于以下问题:C++ CMusicInfoTag::GetMusicBrainzTrackID方法的具体用法?C++ CMusicInfoTag::GetMusicBrainzTrackID怎么用?C++ CMusicInfoTag::GetMusicBrainzTrackID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMusicInfoTag
的用法示例。
在下文中一共展示了CMusicInfoTag::GetMusicBrainzTrackID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CSong::CSong(CMusicInfoTag& tag)
{
SYSTEMTIME stTime;
tag.GetReleaseDate(stTime);
strTitle = tag.GetTitle();
genre = tag.GetGenre();
strFileName = tag.GetURL();
artist = tag.GetArtist();
strAlbum = tag.GetAlbum();
albumArtist = tag.GetAlbumArtist();
strMusicBrainzTrackID = tag.GetMusicBrainzTrackID();
strMusicBrainzArtistID = tag.GetMusicBrainzArtistID();
strMusicBrainzAlbumID = tag.GetMusicBrainzAlbumID();
strMusicBrainzAlbumArtistID = tag.GetMusicBrainzAlbumArtistID();
strMusicBrainzTRMID = tag.GetMusicBrainzTRMID();
strComment = tag.GetComment();
rating = tag.GetRating();
iYear = stTime.wYear;
iTrack = tag.GetTrackAndDiskNumber();
iDuration = tag.GetDuration();
bCompilation = tag.GetCompilation();
embeddedArt = tag.GetCoverArtInfo();
strThumb = "";
iStartOffset = 0;
iEndOffset = 0;
idSong = -1;
iTimesPlayed = 0;
iKaraokeNumber = 0;
iKaraokeDelay = 0; //! Karaoke song lyrics-music delay in 1/10 seconds.
iAlbumId = -1;
}
示例2: AddSong
int CScrobbler::AddSong(const CMusicInfoTag& tag)
{
if ((!g_guiSettings.GetBool("lastfm.enable") && !g_guiSettings.GetBool("lastfm.recordtoprofile")) || !g_guiSettings.GetBool("network.enableinternet"))
return 0;
if (tag.GetDuration() <= MINLENGTH || tag.GetDuration() > MAXLENGTH) // made <= to minlength to stop iTMS previews being submitted in iTunes
return 0;
if (!tag.Loaded() || tag.GetArtist().IsEmpty() || tag.GetTitle().IsEmpty())
return 0;
if(m_bSubmitInProgress)
{
StatusUpdate(S_NOT_SUBMITTING,"Previous submission still in progress");
return 0;
}
char ti[20];
struct tm *today = gmtime(&m_SongStartTime);
strftime(ti, sizeof(ti), "%Y-%m-%d %H:%M:%S", today);
CStdString a, b, t;
// our tags are stored as UTF-8, so no conversion needed
a = tag.GetArtist();
b = tag.GetAlbum();
t = tag.GetTitle();
CStdString i=ti;
CStdString m=tag.GetMusicBrainzTrackID();
CUtil::URLEncode(a);
CUtil::URLEncode(b);
CUtil::URLEncode(t);
CUtil::URLEncode(i);
CUtil::URLEncode(m);
CStdString strSubmitStr;
strSubmitStr.Format("a[%i]=%s&t[%i]=%s&b[%i]=%s&m[%i]=%s&l[%i]=%i&i[%i]=%s&", m_iSongNum, a.c_str(), m_iSongNum, t.c_str(), m_iSongNum, b.c_str(), m_iSongNum, m.c_str(), m_iSongNum, tag.GetDuration(), m_iSongNum, i.c_str());
if(m_strPostString.find(ti) != m_strPostString.npos)
{
// we have already tried to add a song at this time stamp
// I have no idea how this could happen but apparently it does so
// we stop it now
StatusUpdate(S_NOT_SUBMITTING,strSubmitStr);
StatusUpdate(S_NOT_SUBMITTING,m_strPostString);
StatusUpdate(S_NOT_SUBMITTING,"Submission error, duplicate subbmission time found");
return 3;
}
m_strPostString += strSubmitStr;
m_iSongNum++;
SaveCache(m_strPostString.c_str(), m_iSongNum);
time_t now;
time (&now);
if ((m_Interval + m_LastConnect) < now)
{
DoSubmit();
return 1;
}
else
{
CStdString strMsg;
strMsg.Format("Not submitting, caching for %i more seconds. Cache is %i entries.", (int)(m_Interval + m_LastConnect - now), m_iSongNum);
StatusUpdate(S_NOT_SUBMITTING,strMsg);
return 2;
}
}