Compare commits

...

1 Commits

@ -99,6 +99,8 @@ namespace NLGUI
// Get the number of active children
uint getNumActiveChildren() const;
uint getMaxElements() const { return _MaxElements; }
/**
* set the template that will be used to add text;
* \templ : a CViewText object. Only its font size, color and shadow are required.

@ -158,8 +158,21 @@ bool CMusicPlayer::isShuffleEnabled() const
// ***************************************************************************
void CMusicPlayer::playSongs (const std::vector<std::string> &filenames)
{
CGroupList *pList = dynamic_cast<CGroupList *>(CWidgetManager::getInstance()->getElementFromId(MP3_PLAYER_PLAYLIST_LIST));
if (!pList)
{
nlwarning("MusicPlayer UI not found (%s)", MP3_PLAYER_PLAYLIST_LIST);
return;
}
uint limit = pList->getMaxElements();
if (filenames.size() > limit)
{
CInterfaceManager::getInstance()->displaySystemInfo(toString("Found %u, limit %u", filenames.size(), limit), "SYS");
}
_Songs.clear();
for (uint i=0; i<filenames.size(); i++)
for (uint i = 0; (i < limit) && (i < filenames.size()); i++)
{
_Songs.push_back(CSongs(filenames[i], CFile::getFilename(filenames[i]), 0.f));
}

Loading…
Cancel
Save