From ff6571b33c655524d12f3410d0bd37cfc0534a49 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Sun, 12 Aug 2007 12:21:17 +0000 Subject: [PATCH] AmPlaylist::close can be used without sending playlist empty events git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@424 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmPlaylist.cpp | 8 ++++---- core/AmPlaylist.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/AmPlaylist.cpp b/core/AmPlaylist.cpp index ad82d9e5..9d959a25 100644 --- a/core/AmPlaylist.cpp +++ b/core/AmPlaylist.cpp @@ -41,7 +41,7 @@ void AmPlaylist::updateCurrentItem() } } -void AmPlaylist::gotoNextItem() +void AmPlaylist::gotoNextItem(bool notify) { bool had_item = false; if(cur_item){ @@ -58,7 +58,7 @@ void AmPlaylist::gotoNextItem() } updateCurrentItem(); - if(had_item && !cur_item){ + if(notify && had_item && !cur_item){ DBG("posting AmAudioEvent::noAudio event!\n"); ev_q->postEvent(new AmAudioEvent(AmAudioEvent::noAudio)); } @@ -142,11 +142,11 @@ void AmPlaylist::addToPlayListFront(AmPlaylistItem* item) cur_mut.unlock(); } -void AmPlaylist::close() +void AmPlaylist::close(bool notify) { cur_mut.lock(); while(cur_item) - gotoNextItem(); + gotoNextItem(notify); cur_mut.unlock(); } diff --git a/core/AmPlaylist.h b/core/AmPlaylist.h index 8798ea52..eb3605d9 100644 --- a/core/AmPlaylist.h +++ b/core/AmPlaylist.h @@ -66,7 +66,7 @@ class AmPlaylist: public AmAudio AmEventQueue* ev_q; void updateCurrentItem(); - void gotoNextItem(); + void gotoNextItem(bool notify = true); protected: // Fake implement AmAudio's pure virtual methods @@ -85,7 +85,7 @@ class AmPlaylist: public AmAudio void addToPlaylist(AmPlaylistItem* item); void addToPlayListFront(AmPlaylistItem* item); - void close(); + void close(bool notify = true); }; /**