summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b>2004-09-25 14:17:11 +0000
committerlvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b>2004-09-25 14:17:11 +0000
commit5879bd13d018fa9074e304507d3eb0f26a27e2a7 (patch)
tree77b9f272a99268aadf9e8ae992a73259a2fa29f5
parent44a755e932b67f1d0d5c53a8383367b3785bbc16 (diff)
downloadvdr-plugin-muggle-5879bd13d018fa9074e304507d3eb0f26a27e2a7.tar.gz
vdr-plugin-muggle-5879bd13d018fa9074e304507d3eb0f26a27e2a7.tar.bz2
Playlists seem now to work correctly
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@182 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r--mg_playlist.h13
-rw-r--r--vdr_player.c49
2 files changed, 36 insertions, 26 deletions
diff --git a/mg_playlist.h b/mg_playlist.h
index addf52e..30443f4 100644
--- a/mg_playlist.h
+++ b/mg_playlist.h
@@ -133,22 +133,25 @@ public:
/*! \brief returns the nth track from the playlist
*
* \param position - the position to skip to
+ * \return true if position was okay and changed, false otherwise
*/
- virtual void gotoPosition(unsigned int position);
+ virtual bool gotoPosition(unsigned int position);
/*!
* \brief proceeds to the next item
*
- * \todo Handle loop mode
+ * \return true if position was okay and changed, false otherwise
+ * \todo Handle play modes
*/
- virtual void skipFwd();
+ virtual bool skipFwd();
/*!
* \brief goes back to the previous item
*
- * \todo Handle loop mode
+ * \return true if position was okay and changed, false otherwise
+ * \todo Handle play modes
*/
- virtual void skipBack();
+ virtual bool skipBack();
//! \brief obtain the next item without skipping the current position
virtual mgContentItem* sneakNext();
diff --git a/vdr_player.c b/vdr_player.c
index 32ca216..c2a65ca 100644
--- a/vdr_player.c
+++ b/vdr_player.c
@@ -168,10 +168,10 @@ private:
//
int m_index;
- void Empty(void);
- bool NextFile(void);
- bool PrevFile(void);
- void StopPlay(void);
+ void Empty();
+ bool NextFile( );
+ bool PrevFile();
+ void StopPlay();
void SetPlayMode(ePlayMode mode);
void WaitPlayMode(ePlayMode mode, bool inv);
@@ -184,11 +184,11 @@ public:
mgPCMPlayer(mgPlaylist *plist);
virtual ~mgPCMPlayer();
- bool Active(void) { return m_active; }
- void Pause(void);
- void Play(void);
- void Forward(void);
- void Backward(void);
+ bool Active() { return m_active; }
+ void Pause();
+ void Play();
+ void Forward();
+ void Backward();
void Goto(int Index, bool Still=false);
void SkipSeconds(int secs);
void ToggleShuffle(void);
@@ -673,7 +673,7 @@ void mgPCMPlayer::StopPlay()
}
}
-bool mgPCMPlayer::NextFile()
+bool mgPCMPlayer::NextFile( )
{
mgContentItem *newcurr;
@@ -707,12 +707,17 @@ bool mgPCMPlayer::NextFile()
- move corresponding playlist item to front
- continue
*/
-
}
else
{
- m_playlist->skipFwd();
- newcurr = m_playlist->getCurrent();
+ if( m_playlist->skipFwd() )
+ {
+ newcurr = m_playlist->getCurrent();
+ }
+ else
+ {
+ newcurr = &(mgContentItem::UNDEFINED);
+ }
}
if( newcurr && newcurr != &(mgContentItem::UNDEFINED) )
@@ -727,14 +732,16 @@ bool mgPCMPlayer::NextFile()
bool mgPCMPlayer::PrevFile(void)
{
bool res = false;
-
- m_playlist->skipBack();
- mgContentItem *newcurr = m_playlist->getCurrent();
- if( newcurr && newcurr != &(mgContentItem::UNDEFINED) )
+ if( m_playlist->skipBack() )
{
- m_current = newcurr;
- res = true;
+ mgContentItem *newcurr = m_playlist->getCurrent();
+
+ if( newcurr && newcurr != &(mgContentItem::UNDEFINED) )
+ {
+ m_current = newcurr;
+ res = true;
+ }
}
return res;
@@ -784,12 +791,12 @@ void mgPCMPlayer::Play(void)
Unlock();
}
-void mgPCMPlayer::Forward(void)
+void mgPCMPlayer::Forward()
{
MGLOG( "mgPCMPlayer::Forward" );
Lock();
- if( NextFile() )
+ if( NextFile() )
{
StopPlay();
Play();