void CAirTunesServer::SetMetadataFromBuffer(const char *buffer, unsigned int size) { MUSIC_INFO::CMusicInfoTag tag; std::map<std::string, std::string> metadata = decodeDMAP(buffer, size); if(metadata["asal"].length()) tag.SetAlbum(metadata["asal"]);//album if(metadata["minm"].length()) tag.SetTitle(metadata["minm"]);//title if(metadata["asar"].length()) tag.SetArtist(metadata["asar"]);//artist CApplicationMessenger::Get().SetCurrentSongTag(tag); }
void CAirTunesServer::RefreshMetadata() { CSingleLock lock(m_metadataLock); MUSIC_INFO::CMusicInfoTag tag; if (m_metadata[0].length()) tag.SetAlbum(m_metadata[0]);//album if (m_metadata[1].length()) tag.SetTitle(m_metadata[1]);//title if (m_metadata[2].length()) tag.SetArtist(m_metadata[2]);//artist CApplicationMessenger::Get().SetCurrentSongTag(tag); }
void CAirTunesServer::RefreshMetadata() { CSingleLock lock(m_metadataLock); MUSIC_INFO::CMusicInfoTag tag; if (g_infoManager.GetCurrentSongTag()) tag = *g_infoManager.GetCurrentSongTag(); if (m_metadata[0].length()) tag.SetAlbum(m_metadata[0]);//album if (m_metadata[1].length()) tag.SetTitle(m_metadata[1]);//title if (m_metadata[2].length()) tag.SetArtist(m_metadata[2]);//artist CApplicationMessenger::GetInstance().PostMsg(TMSG_UPDATE_CURRENT_ITEM, 1, -1, static_cast<void*>(new CFileItem(tag))); }
bool CAudioDecoder::Load(const std::string& fileName, MUSIC_INFO::CMusicInfoTag& tag, MUSIC_INFO::EmbeddedArt* art) { if (!Initialized()) return false; char title[256]; char artist[256]; int length; if (m_pStruct->ReadTag(fileName.c_str(), title, artist, &length)) { tag.SetTitle(title); tag.SetArtist(artist); tag.SetDuration(length); return true; } return false; }