diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/qmmpui/playstate.cpp | 13 | ||||
| -rw-r--r-- | src/ui/txt/thanks_en.txt | 2 | ||||
| -rw-r--r-- | src/ui/txt/thanks_ru.txt | 2 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/qmmpui/playstate.cpp b/src/qmmpui/playstate.cpp index d730e6fda..50db86459 100644 --- a/src/qmmpui/playstate.cpp +++ b/src/qmmpui/playstate.cpp @@ -38,9 +38,8 @@ bool ShufflePlayState::next() else prepare(); } - - if (m_shuffled_current < m_shuffled_indexes.count() - 1) - m_shuffled_current++; + else + m_shuffled_current = (m_shuffled_current + 1) % m_shuffled_indexes.count(); return m_model->setCurrent(m_shuffled_indexes.at(m_shuffled_current)); } @@ -61,7 +60,7 @@ int ShufflePlayState::nextIndex() else prepare(); } - return m_shuffled_indexes.at(m_shuffled_current + 1); + return m_shuffled_indexes.at((m_shuffled_current + 1) % m_shuffled_indexes.count()); } bool ShufflePlayState::previous() @@ -93,14 +92,14 @@ bool ShufflePlayState::previous() void ShufflePlayState::prepare() { resetState(); - for (int i = 0;i < m_model->items().count();i++) + for(int i = 0;i < m_model->items().count();i++) { if (i != m_model->currentRow()) m_shuffled_indexes << i; } - for (int i = 0;i < m_shuffled_indexes.count();i++) - m_shuffled_indexes.swap(qrand()%m_shuffled_indexes.size(),qrand()%m_shuffled_indexes.size()); + 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()); } diff --git a/src/ui/txt/thanks_en.txt b/src/ui/txt/thanks_en.txt index 796fd9b7a..987e0c1ea 100644 --- a/src/ui/txt/thanks_en.txt +++ b/src/ui/txt/thanks_en.txt @@ -2,6 +2,8 @@ Thanks to: Adria Arrufat <swiftscythe@gmail.com> - bug reports Adrian Knoth <adi@drcomp.erfurt.thur.de> - jack plugin fixes, bug reports + Anton Petrusevich <casus@casus.us> - random playback improvements + Avihay Baratz <avihayb@gmail.com> - auto stop feature, bug fixes Csaba Hruska <csaba.hruska@gmail.com> - ffmpeg plugin fixes Dmitry Kostin <kostindima@gmail.com> - iso.wv support Gennadi Motsyo <drool@altlinux.ru> - bug reports diff --git a/src/ui/txt/thanks_ru.txt b/src/ui/txt/thanks_ru.txt index d88f685d9..583623642 100644 --- a/src/ui/txt/thanks_ru.txt +++ b/src/ui/txt/thanks_ru.txt @@ -2,6 +2,8 @@ Adria Arrufat <swiftscythe@gmail.com> - сообщения об ошибках Adrian Knoth <adi@drcomp.erfurt.thur.de> - исправления в модуле jack plugin, сообщения об ошибках + Anton Petrusevich <casus@casus.us> - улучшение случайного воспроизведения + Avihay Baratz <avihayb@gmail.com> - опции авто-остановки, исправления ошибок Csaba Hruska <csaba.hruska@gmail.com> - исправления в модуле ffmpeg Dmitry Kostin <kostindima@gmail.com> - поддержка iso.wv Геннадий Моцьо <drool@altlinux.ru> - сообщения об ошибках |
