From c6e0029ee9ead0cc4c638831048f605b8160d1de Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 15 Sep 2010 19:13:24 +0000 Subject: fixed crossfade with queued songs git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1889 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmpui/playlistmodel.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/qmmpui/playlistmodel.cpp') diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp index 58cac7770..7cfe7fb09 100644 --- a/src/qmmpui/playlistmodel.cpp +++ b/src/qmmpui/playlistmodel.cpp @@ -147,8 +147,10 @@ PlayListItem* PlayListModel::currentItem() PlayListItem* PlayListModel::nextItem() { - if(m_items.isEmpty() || !isEmptyQueue() || !m_play_state) + if(m_items.isEmpty() || !m_play_state) return 0; + if(!isEmptyQueue()) + return m_queued_songs.at(0); int index = m_play_state->nextIndex(); if(index < 0 || (index + 1 > m_items.count())) return 0; @@ -621,9 +623,9 @@ void PlayListModel::addToQueue() void PlayListModel::setQueued(PlayListItem* file) { if (isQueued(file)) - m_queued_songs.removeAt(m_queued_songs.indexOf(file)); + m_queued_songs.removeAll(file); else - m_queued_songs.append(file); + m_queued_songs.enqueue(file); emit listChanged(); } @@ -634,8 +636,7 @@ bool PlayListModel::isQueued(PlayListItem* f) const void PlayListModel::setCurrentToQueued() { - setCurrent(row(m_queued_songs.at(0))); - m_queued_songs.pop_front(); + setCurrent(row(m_queued_songs.dequeue())); } bool PlayListModel::isEmptyQueue() const -- cgit v1.2.3-13-gbd6f