diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-12-15 09:55:53 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-12-15 09:55:53 +0000 |
| commit | 3a965fcd45d585c7e49afcc4b0d2e2d6ef8fe1f5 (patch) | |
| tree | d9ff3cd9621804632dca6001ad20ffb5f52de3f8 /src/qmmpui/playstate.cpp | |
| parent | f31d9ccf3dda970ce2f4139a8c2ab205759c5523 (diff) | |
| download | qmmp-3a965fcd45d585c7e49afcc4b0d2e2d6ef8fe1f5.tar.gz qmmp-3a965fcd45d585c7e49afcc4b0d2e2d6ef8fe1f5.tar.bz2 qmmp-3a965fcd45d585c7e49afcc4b0d2e2d6ef8fe1f5.zip | |
added playlists auto-save feauture (patch by Ferdinand Vesely) (Closes
issue 536), changed playlist api
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3063 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playstate.cpp')
| -rw-r--r-- | src/qmmpui/playstate.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qmmpui/playstate.cpp b/src/qmmpui/playstate.cpp index 065a3ddd2..e9d4c7aeb 100644 --- a/src/qmmpui/playstate.cpp +++ b/src/qmmpui/playstate.cpp @@ -94,14 +94,14 @@ void ShufflePlayState::prepare() resetState(); for(int i = 0;i < m_model->items().count();i++) { - if (i != m_model->currentRow()) + if (i != m_model->currentIndex()) m_shuffled_indexes << i; } for (int i = 0; i < m_shuffled_indexes.count(); i++) m_shuffled_indexes.swap(i, qrand()%m_shuffled_indexes.size()); - m_shuffled_indexes.prepend(m_model->currentRow()); + m_shuffled_indexes.prepend(m_model->currentIndex()); } void ShufflePlayState::resetState() @@ -120,14 +120,14 @@ bool NormalPlayState::next() if (itm_count > 0) { - if ( m_model->currentRow() == itm_count - 1) + if ( m_model->currentIndex() == itm_count - 1) { if (m_model->isRepeatableList()) return m_model->setCurrent(0); else return false; } - return m_model->setCurrent(m_model->currentRow() + 1); + return m_model->setCurrent(m_model->currentIndex() + 1); } else return false; @@ -139,9 +139,9 @@ bool NormalPlayState::previous() if (itm_count > 0) { - if ( m_model->currentRow() < 1 && !m_model->isRepeatableList()) + if ( m_model->currentIndex() < 1 && !m_model->isRepeatableList()) return false; - else if (m_model->setCurrent(m_model->currentRow() - 1)) + else if (m_model->setCurrent(m_model->currentIndex() - 1)) return true; else if (m_model->isRepeatableList()) return m_model->setCurrent(m_model->items().count() - 1); @@ -156,13 +156,13 @@ int NormalPlayState::nextIndex() if(!itm_count) return -1; - if (m_model->currentRow() == itm_count - 1) + if (m_model->currentIndex() == itm_count - 1) { if (m_model->isRepeatableList()) return 0; else return -1; } - return m_model->currentRow() + 1; + return m_model->currentIndex() + 1; } |
