diff options
author | Chris Xiong <chirs241097@gmail.com> | 2020-08-05 00:19:31 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2020-08-05 00:19:31 +0800 |
commit | a3b10c29c5041a4706bd2e4badf25c3269909aa6 (patch) | |
tree | c81039121419cda080aa2aee700a49ced6694421 /qmidiplayer-desktop/qmpmainwindow.cpp | |
parent | db54b5d51d5269c2e17964e0e9842f4a2f210673 (diff) | |
download | QMidiPlayer-a3b10c29c5041a4706bd2e4badf25c3269909aa6.tar.xz |
I can still code!
Next / Prev track is now selected based on the current track being
played rather than the selected track in the playlist window.
Also fixed stupid a mistype.
Diffstat (limited to 'qmidiplayer-desktop/qmpmainwindow.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index 456ae60..41c42c6 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -361,6 +361,8 @@ void qmpMainWindow::switchTrack(QString s, bool interrupt) QString fns = s; setWindowTitle(QUrl::fromLocalFile(fns).fileName().left(QUrl::fromLocalFile(fns).fileName().lastIndexOf('.')) + " - QMidiPlayer"); ui->lbFileName->setText(QUrl::fromLocalFile(fns).fileName().left(QUrl::fromLocalFile(fns).fileName().lastIndexOf('.'))); + if (plistw->getCurrentItem() != fns) + plistw->setCurrentItem(fns); onfnChanged(); if (!loadFile(fns)) return; @@ -687,7 +689,7 @@ void qmpMainWindow::on_pbNext_clicked() void qmpMainWindow::selectionChanged() { - switchTrack(plistw->getSelectedItem()); + switchTrack(plistw->getCurrentItem()); } void qmpMainWindow::on_lbFileName_customContextMenuRequested(const QPoint &pos) @@ -793,8 +795,8 @@ void qmpMainWindow::startRender() free(ifstr); #else fluidrenderer = new qmpFileRendererFluid( - plistw->getSelectedItem().toStdString().c_str(), - (plistw->getSelectedItem() + QString(".wav")).toStdString().c_str() + plistw->getCurrentItem().toStdString().c_str(), + (plistw->getCurrentItem() + QString(".wav")).toStdString().c_str() ); playerSetup(fluidrenderer); fluidrenderer->renderInit(); |