3 * Copyright (C) 2005-2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
22 #include "utils/StdString.h"
24 #include <boost/shared_ptr.hpp>
26 class CFileItem; typedef boost::shared_ptr<CFileItem> CFileItemPtr;
35 PARTYMODECONTEXT_UNKNOWN,
36 PARTYMODECONTEXT_MUSIC,
37 PARTYMODECONTEXT_VIDEO
40 class CPartyModeManager
43 CPartyModeManager(void);
44 virtual ~CPartyModeManager(void);
46 bool Enable(PartyModeContext context=PARTYMODECONTEXT_MUSIC, const CStdString& strXspPath = "");
49 void OnSongChange(bool bUpdatePlayed = false);
50 void AddUserSongs(PLAYLIST::CPlayList& tempList, bool bPlay = false);
51 void AddUserSongs(CFileItemList& tempList, bool bPlay = false);
52 bool IsEnabled(PartyModeContext context=PARTYMODECONTEXT_UNKNOWN) const;
54 int GetMatchingSongs();
55 int GetMatchingSongsPicked();
56 int GetMatchingSongsLeft();
57 int GetRelaxedSongs();
59 PartyModeContext GetType() const;
63 bool AddRandomSongs(int iSongs = 0);
64 bool AddInitialSongs(std::vector< std::pair<int,int> > &songIDs);
65 void Add(CFileItemPtr &pItem);
68 void SendUpdateMessage();
69 void OnError(int iError, const CStdString& strLogMessage);
72 std::pair<CStdString,CStdString> GetWhereClauseWithHistory() const;
73 void AddToHistory(int type, int songID);
74 void GetRandomSelection(std::vector< std::pair<int,int> > &in, unsigned int number, std::vector< std::pair<int, int> > &out);
81 CStdString m_strCurrentFilterMusic;
82 CStdString m_strCurrentFilterVideo;
88 int m_iMatchingSongsPicked;
89 int m_iMatchingSongsLeft;
94 unsigned int m_songsInHistory;
95 std::vector< std::pair<int,int> > m_history;
98 extern CPartyModeManager g_partyModeManager;