From 8312d07034c25b3aa0a8c9f8be358b4c9cc9f18f Mon Sep 17 00:00:00 2001 From: phintuka Date: Mon, 13 Sep 2010 11:39:34 +0000 Subject: Added cPlaylist::Move() (Thanks to Marco Skambraks) --- tools/playlist.c | 13 ++++++++++++- tools/playlist.h | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/playlist.c b/tools/playlist.c index 65fe4057..8ced772a 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.29 2010-03-12 22:47:28 phintuka Exp $ + * $Id: playlist.c,v 1.30 2010-09-13 11:39:34 phintuka Exp $ * */ @@ -491,6 +491,17 @@ void cPlaylist::Del(cPlaylistItem *it) m_Version++; } +void cPlaylist::Move(int From, int To) +{ + cMutexLock ml(&m_Lock); + + if (Count() < 3) + return; + + cListBase::Move(From, To); + m_Version++; +} + void cPlaylist::SetCurrent(cPlaylistItem *current) { cMutexLock ml(&m_Lock); diff --git a/tools/playlist.h b/tools/playlist.h index 3becbeb4..d7de7622 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.12 2010-03-12 22:47:28 phintuka Exp $ + * $Id: playlist.h,v 1.13 2010-09-13 11:39:34 phintuka Exp $ * */ @@ -109,6 +109,7 @@ class cPlaylist : protected cList bool Read(const char *PlaylistFile, bool Recursive = false); void StartScanner(void); void Del(cPlaylistItem *it); + void Move(int From, int To); void Sort(void); int Count(void) const; -- cgit v1.2.3