mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-25 02:10:53 +00:00
Fixed: Display title and artist name from ogg files in music player
--HG-- branch : develop
This commit is contained in:
parent
f9c789e4db
commit
334f2b43c6
2 changed files with 22 additions and 13 deletions
|
@ -2690,21 +2690,30 @@ bool CAudioMixerUser::getSongTitle(const std::string &filename, std::string &res
|
||||||
{
|
{
|
||||||
std::string artist;
|
std::string artist;
|
||||||
std::string title;
|
std::string title;
|
||||||
if (_SoundDriver->getMusicInfo(filename, artist, title))
|
|
||||||
|
if (!_SoundDriver->getMusicInfo(filename, artist, title))
|
||||||
{
|
{
|
||||||
if (!title.empty())
|
// use 3rd party libraries supported formats
|
||||||
{
|
IAudioDecoder::getInfo(filename, artist, title);
|
||||||
if (!artist.empty()) result = artist + " - " + title;
|
|
||||||
else result = title;
|
|
||||||
}
|
|
||||||
else if (!artist.empty())
|
|
||||||
{
|
|
||||||
result = artist + " - " + CFile::getFilename(filename);
|
|
||||||
}
|
|
||||||
else result = CFile::getFilename(filename);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!title.empty())
|
||||||
|
{
|
||||||
|
if (!artist.empty()) result = artist + " - " + title;
|
||||||
|
else result = title;
|
||||||
|
}
|
||||||
|
else if (!artist.empty())
|
||||||
|
{
|
||||||
|
result = artist + " - " + CFile::getFilename(filename);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = CFile::getFilename(filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = "???";
|
result = "???";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ void CMusicPlayer::play ()
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||||
CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:mp3_player:screen:text"));
|
CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:mp3_player:screen:text"));
|
||||||
if (pVT)
|
if (pVT)
|
||||||
pVT->setText (_Songs[_CurrentSong].Title);
|
pVT->setText (ucstring::makeFromUtf8(_Songs[_CurrentSong].Title));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue