summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/playlist.c22
-rw-r--r--tools/playlist.h4
2 files changed, 24 insertions, 2 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");
diff --git a/tools/playlist.h b/tools/playlist.h
index 870e8469..bff19ff9 100644
--- a/tools/playlist.h
+++ b/tools/playlist.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: playlist.h,v 1.2 2006-12-24 00:19:18 phintuka Exp $
+ * $Id: playlist.h,v 1.3 2007-01-03 19:12:18 phintuka Exp $
*
*/
@@ -107,6 +107,8 @@ class cPlaylist : protected cList<cPlaylistItem>
// read playlist from file or create playlist from directory tree
bool Read(const char *PlaylistFile, bool Recursive = false);
void StartScanner(void);
+ void Del(cPlaylistItem *it);
+
void Sort(void);
int Count(void) const;