2 * Copyright (C) 2005-2008 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, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
22 #include "DirectoryNodeTop100.h"
24 #include "guilib/LocalizeStrings.h"
27 using namespace XFILE::MUSICDATABASEDIRECTORY;
29 Node Top100Children[] = {
30 { NODE_TYPE_SONG_TOP100, 1, 10504 },
31 { NODE_TYPE_ALBUM_TOP100, 2, 10505 },
34 CDirectoryNodeTop100::CDirectoryNodeTop100(const CStdString& strName, CDirectoryNode* pParent)
35 : CDirectoryNode(NODE_TYPE_TOP100, strName, pParent)
40 NODE_TYPE CDirectoryNodeTop100::GetChildType() const
42 for (unsigned int i = 0; i < sizeof(Top100Children) / sizeof(Node); ++i)
43 if (GetID() == Top100Children[i].id)
44 return Top100Children[i].node;
46 return NODE_TYPE_NONE;
49 CStdString CDirectoryNodeTop100::GetLocalizedName() const
51 for (unsigned int i = 0; i < sizeof(Top100Children) / sizeof(Node); ++i)
52 if (GetID() == Top100Children[i].id)
53 return g_localizeStrings.Get(Top100Children[i].label);
57 bool CDirectoryNodeTop100::GetContent(CFileItemList& items) const
59 for (unsigned int i = 0; i < sizeof(Top100Children) / sizeof(Node); ++i)
61 CFileItemPtr pItem(new CFileItem(g_localizeStrings.Get(Top100Children[i].label)));
63 strDir.Format("%ld/", Top100Children[i].id);
64 pItem->m_strPath += BuildPath() + strDir;
65 pItem->m_bIsFolder = true;