diff --git a/nel/include/nel/gui/group_list.h b/nel/include/nel/gui/group_list.h index e7fda6eb3..02e3847f7 100644 --- a/nel/include/nel/gui/group_list.h +++ b/nel/include/nel/gui/group_list.h @@ -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. diff --git a/ryzom/client/src/interface_v3/music_player.cpp b/ryzom/client/src/interface_v3/music_player.cpp index e406b83a8..ab79c96c1 100644 --- a/ryzom/client/src/interface_v3/music_player.cpp +++ b/ryzom/client/src/interface_v3/music_player.cpp @@ -158,8 +158,21 @@ bool CMusicPlayer::isShuffleEnabled() const // *************************************************************************** void CMusicPlayer::playSongs (const std::vector &filenames) { + CGroupList *pList = dynamic_cast(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