Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 201 lines (170 sloc) 7.144 kB
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
1 #pragma once
2 /*
3 * Copyright (C) 2005-2008 Team XBMC
4 * http://www.xbmc.org
5 *
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)
9 * any later version.
10 *
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.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 * http://www.gnu.org/copyleft/gpl.html
20 *
21 */
22
c51b118 Merged cptspiff's code-reshuffle branch.
theuni authored
23 #include "guilib/IMsgTargetCallback.h"
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
24 #include <boost/shared_ptr.hpp>
25
26 #define PLAYLIST_NONE -1
27 #define PLAYLIST_MUSIC 0
28 #define PLAYLIST_VIDEO 1
302fdda @Montellese jsonrpc: refactor (Audio|Video|Picture)Player and (Audio|Video)Playlist
Montellese authored
29 #define PLAYLIST_PICTURE 2
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
30
31 class CFileItem; typedef boost::shared_ptr<CFileItem> CFileItemPtr;
32 class CFileItemList;
33
34 namespace PLAYLIST
35 {
36 /*!
37 \ingroup windows
38 \brief Manages playlist playing.
39 */
40 enum REPEAT_STATE { REPEAT_NONE = 0, REPEAT_ONE, REPEAT_ALL };
41
42 class CPlayList;
43
44 class CPlayListPlayer : public IMsgTargetCallback
45 {
46
47 public:
48 CPlayListPlayer(void);
49 virtual ~CPlayListPlayer(void);
50 virtual bool OnMessage(CGUIMessage &message);
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
51
52 /*! \brief Play the next (or another) entry in the current playlist
53 \param offset The offset from the current entry (defaults to 1, i.e. the next entry).
54 \param autoPlay Whether we should start playing if not already (defaults to false).
55 */
afb416a added: return state for PlayListPlayer operations, result callback fo…
malard authored
56 bool PlayNext(int offset = 1, bool autoPlay = false);
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
57
58 /*! \brief Play the previous entry in the current playlist
59 \sa PlayNext
60 */
afb416a added: return state for PlayListPlayer operations, result callback fo…
malard authored
61 bool PlayPrevious();
62 bool PlaySongId(int songId);
63 bool Play();
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
64
65 /*! \brief Start playing a particular entry in the current playlist
66 \param index the index of the item to play. This value is modified to ensure it lies within the current playlist.
67 \param replace whether this item should replace the currently playing item. See CApplication::PlayFile (defaults to false).
68 \param playPreviousOnFail whether to go back to the previous item if playback fails (default to false)
69 */
afb416a added: return state for PlayListPlayer operations, result callback fo…
malard authored
70 bool Play(int index, bool replace = false, bool playPreviousOnFail = false);
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
71
72 /*! \brief Returns the index of the current item in active playlist.
73 \return Current item in the active playlist.
74 \sa SetCurrentSong
75 */
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
76 int GetCurrentSong() const;
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
77
78 /*! \brief Change the current item in the active playlist.
79 \param index item index in playlist. Set only if the index is within the range of the current playlist.
80 \sa GetCurrentSong
81 */
82 void SetCurrentSong(int index);
83
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
84 int GetNextSong();
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
85
86 /*! \brief Get the index in the playlist that is offset away from the current index in the current playlist.
87 Obeys any repeat settings (eg repeat one will return the current index regardless of offset)
88 \return the index of the entry, or -1 if there is no current playlist. There is no guarantee that the returned index is valid.
89 */
90 int GetNextSong(int offset) const;
91
92 /*! \brief Set the active playlist
93 \param playList Values can be PLAYLIST_NONE, PLAYLIST_MUSIC or PLAYLIST_VIDEO
94 \sa GetCurrentPlaylist
95 */
96 void SetCurrentPlaylist(int playlist);
97
98 /*! \brief Get the currently active playlist
99 \return PLAYLIST_NONE, PLAYLIST_MUSIC or PLAYLIST_VIDEO
100 \sa SetCurrentPlaylist, GetPlaylist
101 */
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
102 int GetCurrentPlaylist() const;
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
103
104 /*! \brief Get a particular playlist object
105 \param playList Values can be PLAYLIST_MUSIC or PLAYLIST_VIDEO
106 \return A reference to the CPlayList object.
107 \sa GetCurrentPlaylist
108 */
109 CPlayList& GetPlaylist(int playlist);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
110 const CPlayList& GetPlaylist(int iPlaylist) const;
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
111
112 /*! \brief Removes any item from all playlists located on a removable share
113 \return Number of items removed from PLAYLIST_MUSIC and PLAYLIST_VIDEO
114 */
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
115 int RemoveDVDItems();
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
116
117 /*! \brief Resets the current song and unplayable counts.
118 Does not alter the active playlist.
119 */
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
120 void Reset();
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
121
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
122 void ClearPlaylist(int iPlaylist);
123 void Clear();
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
124
125 /*! \brief Set shuffle state of a playlist.
126 If the shuffle state changes, the playlist is shuffled or unshuffled.
127 Has no effect if Party Mode is enabled.
128 \param playlist the playlist to (un)shuffle, PLAYLIST_MUSIC or PLAYLIST_VIDEO.
129 \param shuffle set true to shuffle, false to unshuffle.
6e3d6a8 @garbear Added: optional second parameter "notify" to XBMC.PlayerControl(Rando…
garbear authored
130 \param notify notify the user with a Toast notification (defaults to false)
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
131 \sa IsShuffled
132 */
6e3d6a8 @garbear Added: optional second parameter "notify" to XBMC.PlayerControl(Rando…
garbear authored
133 void SetShuffle(int playlist, bool shuffle, bool notify = false);
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
134
135 /*! \brief Return whether a playlist is shuffled.
136 If partymode is enabled, this always returns false.
137 \param playlist the playlist to query for shuffle state, PLAYLIST_MUSIC or PLAYLIST_VIDEO.
138 \return true if the given playlist is shuffled and party mode isn't enabled, false otherwise.
139 \sa SetShuffle
140 */
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
141 bool IsShuffled(int iPlaylist) const;
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
142
143 /*! \brief Return whether or not something has been played yet from the current playlist.
144 \return true if something has been played, false otherwise.
145 */
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
146 bool HasPlayedFirstFile() const;
147
282259d @garbear Added: optional second parameter "notify" to the XBMC.PlayerControl(R…
garbear authored
148 /*! \brief Set repeat state of a playlist.
149 If called while in Party Mode, repeat is disabled.
150 \param playlist the playlist to set repeat state for, PLAYLIST_MUSIC or PLAYLIST_VIDEO.
151 \param state set to REPEAT_NONE, REPEAT_ONE or REPEAT_ALL
152 \param notify notify the user with a Toast notification
153 \sa GetRepeat
154 */
155 void SetRepeat(int iPlaylist, REPEAT_STATE state, bool notify = false);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
156 REPEAT_STATE GetRepeat(int iPlaylist) const;
157
158 // add items via the playlist player
159 void Add(int iPlaylist, CPlayList& playlist);
160 void Add(int iPlaylist, const CFileItemPtr &pItem);
161 void Add(int iPlaylist, CFileItemList& items);
8a7542f added: JSONRPC AudioPlaylist.Insert *Playlist.Remove - Thanks Kabooga
malard authored
162 void Insert(int iPlaylist, CPlayList& playlist, int iIndex);
163 void Insert(int iPlaylist, const CFileItemPtr &pItem, int iIndex);
164 void Insert(int iPlaylist, CFileItemList& items, int iIndex);
165 void Remove(int iPlaylist, int iPosition);
63cba75 @Montellese jsonrpc: add (Video|Audio)Playlist.Swap (fixes #11046)
Montellese authored
166 void Swap(int iPlaylist, int indexItem1, int indexItem2);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
167 protected:
2c7537e cleanup: Move doxy comments to header and improve their accuracy. In…
jmarshallnz authored
168 /*! \brief Returns true if the given is set to repeat all
169 \param playlist Playlist to be query
170 \return true if the given playlist is set to repeat all, false otherwise.
171 */
172 bool Repeated(int playlist) const;
173
174 /*! \brief Returns true if the given is set to repeat one
175 \param playlist Playlist to be query
176 \return true if the given playlist is set to repeat one, false otherwise.
177 */
178 bool RepeatedOne(int playlist) const;
179
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
180 void ReShuffle(int iPlaylist, int iPosition);
181
182 bool m_bPlayedFirstFile;
183 bool m_bPlaybackStarted;
184 int m_iFailedSongs;
458dd7d cleanup: DWORD -> unsigned int where used for timing, and variable na…
jmarshallnz authored
185 unsigned int m_failedSongsStart;
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
186 int m_iCurrentSong;
187 int m_iCurrentPlayList;
188 CPlayList* m_PlaylistMusic;
189 CPlayList* m_PlaylistVideo;
190 CPlayList* m_PlaylistEmpty;
191 REPEAT_STATE m_repeatState[2];
192 };
193
194 }
195
196 /*!
197 \ingroup windows
198 \brief Global instance of playlist player
199 */
200 extern PLAYLIST::CPlayListPlayer g_playlistPlayer;
Something went wrong with that request. Please try again.