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); }; /**