diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-09-15 19:13:24 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-09-15 19:13:24 +0000 |
| commit | c6e0029ee9ead0cc4c638831048f605b8160d1de (patch) | |
| tree | 5de4346f23116ab0673eb64edbef31dd7e562860 /src/qmmpui | |
| parent | e2bc4908a3397ded862d9e8494544131e4448158 (diff) | |
| download | qmmp-c6e0029ee9ead0cc4c638831048f605b8160d1de.tar.gz qmmp-c6e0029ee9ead0cc4c638831048f605b8160d1de.tar.bz2 qmmp-c6e0029ee9ead0cc4c638831048f605b8160d1de.zip | |
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
Diffstat (limited to 'src/qmmpui')
| -rw-r--r-- | src/qmmpui/playlistmodel.cpp | 11 | ||||
| -rw-r--r-- | src/qmmpui/playlistmodel.h | 3 |
2 files changed, 8 insertions, 6 deletions
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 diff --git a/src/qmmpui/playlistmodel.h b/src/qmmpui/playlistmodel.h index 2f1dca2e4..d6eb3c4f4 100644 --- a/src/qmmpui/playlistmodel.h +++ b/src/qmmpui/playlistmodel.h @@ -24,6 +24,7 @@ #include <QString> #include <QStringList> #include <QMap> +#include <QQueue> #include <QPointer> #include <QVector> #include "playlistitem.h" @@ -455,7 +456,7 @@ private: /*! * Songs in play queue. */ - QList<PlayListItem*> m_queued_songs; + QQueue <PlayListItem*> m_queued_songs; /*! * Is playlist repeatable? */ |
