summaryrefslogtreecommitdiff
path: root/tools/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/playlist.c')
-rw-r--r--tools/playlist.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/tools/playlist.c b/tools/playlist.c
index 373c9da3..c7350bc1 100644
--- a/tools/playlist.c
+++ b/tools/playlist.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: playlist.c,v 1.2 2007-01-03 10:03:38 phintuka Exp $
+ * $Id: playlist.c,v 1.3 2007-01-03 19:12:18 phintuka Exp $
*
*/
@@ -348,6 +348,20 @@ cPlaylistItem *cPlaylist::Current(void)
return m_Current ?: First();
}
+void cPlaylist::Del(cPlaylistItem *it)
+{
+ cMutexLock ml(&m_Lock);
+
+ if(!it || Count() < 2)
+ return;
+
+ if(m_Current == it)
+ m_Current = cList<cPlaylistItem>::Next(Current()) ?:
+ cList<cPlaylistItem>::Prev(Current());
+
+ cListBase::Del(it);
+}
+
void cPlaylist::SetCurrent(cPlaylistItem *current)
{
cMutexLock ml(&m_Lock);
@@ -677,6 +691,12 @@ int cPlaylist::ReadPlaylist(const char *file)
while(NULL != (pt = r.Read(f)) && n < MAX_PLAYLIST_FILES) {
if(NULL != (pt = parser->Parse(pt))) {
+ if(depth && n==0) {
+ // TODO
+ // - add "separator" item
+ // Add(new cPlaylistItem(NULL, Base, "---");
+ }
+
if(xc.IsPlaylistFile(pt)) {
parser->ResetCache();
LOGDBG("cPlaylist: found playlist inside playlist");