2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
21 #include "DirectoryNodeTop100.h"
23 #include "guilib/LocalizeStrings.h"
26 using namespace XFILE::MUSICDATABASEDIRECTORY;
28 Node Top100Children[] = {
29 { NODE_TYPE_SONG_TOP100, 1, 10504 },
30 { NODE_TYPE_ALBUM_TOP100, 2, 10505 },
33 CDirectoryNodeTop100::CDirectoryNodeTop100(const CStdString& strName, CDirectoryNode* pParent)
34 : CDirectoryNode(NODE_TYPE_TOP100, strName, pParent)
39 NODE_TYPE CDirectoryNodeTop100::GetChildType() const
41 for (unsigned int i = 0; i < sizeof(Top100Children) / sizeof(Node); ++i)
42 if (GetID() == Top100Children[i].id)
43 return Top100Children[i].node;
45 return NODE_TYPE_NONE;
48 CStdString CDirectoryNodeTop100::GetLocalizedName() const
50 for (unsigned int i = 0; i < sizeof(Top100Children) / sizeof(Node); ++i)
51 if (GetID() == Top100Children[i].id)
52 return g_localizeStrings.Get(Top100Children[i].label);
56 bool CDirectoryNodeTop100::GetContent(CFileItemList& items) const
58 for (unsigned int i = 0; i < sizeof(Top100Children) / sizeof(Node); ++i)
60 CFileItemPtr pItem(new CFileItem(g_localizeStrings.Get(Top100Children[i].label)));
62 strDir.Format("%ld/", Top100Children[i].id);
63 pItem->SetPath(BuildPath() + strDir);
64 pItem->m_bIsFolder = true;