add support icons
[groove] / splayer.cpp
index e642dd1..a59899d 100644 (file)
@@ -25,7 +25,29 @@ void sPlayer::setPlaylist(playlist *playList)
 void sPlayer::markComplete()
 {
     pl->markPlayed(pl->currentplaying());
-    pl->setCurrentPlaying(-1);
+    if(pl->existAt(pl->currentplaying()+1))
+    {
+        pl->setCurrentPlaying(pl->currentplaying()+1);
+        if(pl->bReady(pl->currentplaying()))
+            this->start(pl->currentplaying());
+    }
+    else
+        pl->setCurrentPlaying(-1);
+}
+void sPlayer::pause()
+{
+    if(media->state() == Phonon::PausedState)
+        media->play();
+    if(media->state() == Phonon::PlayingState)
+        media->pause();
+}
+void sPlayer::playNext()
+{
+    if(pl->existAt(pl->currentplaying()+1))
+    {
+        media->stop();
+        this->markComplete();
+    }
 }
 
 sPlayer::~sPlayer()