aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpplistwindow.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2017-02-10 00:00:57 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2017-02-10 00:00:57 +0800
commit70f0007154992c0bc89e11af4fe7dcc2c493aac3 (patch)
tree67e673820a3be04ccb2aca6fb29ed2e2a9578af8 /qmidiplayer-desktop/qmpplistwindow.cpp
parent620aad63042e0f397ea6691fe92ac40fcc6b6fed (diff)
downloadQMidiPlayer-70f0007154992c0bc89e11af4fe7dcc2c493aac3.tar.xz
Fix building on Windows.
Behavior changes: 1. DnD into the main window now causes the dropped file to play. 2. Switch back to w32usleep to increase bpm accuracy. 3. Scan for plugins in application folder (in Windows), not in the working directory.
Diffstat (limited to 'qmidiplayer-desktop/qmpplistwindow.cpp')
-rw-r--r--qmidiplayer-desktop/qmpplistwindow.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/qmidiplayer-desktop/qmpplistwindow.cpp b/qmidiplayer-desktop/qmpplistwindow.cpp
index 5805fcb..799f99a 100644
--- a/qmidiplayer-desktop/qmpplistwindow.cpp
+++ b/qmidiplayer-desktop/qmpplistwindow.cpp
@@ -228,11 +228,19 @@ void qmpPlistWindow::on_pbShuffle_clicked()
}
}
-QString qmpPlistWindow::getFirstItem()
+QString qmpPlistWindow::getFirstItem(bool a)
{
if(ui->lwFiles->count()==0)return QString();
int id=0;
- if(shuffle)id=rand()%ui->lwFiles->count();
+ if(shuffle&&!a)id=rand()%ui->lwFiles->count();
+ ui->lwFiles->setCurrentRow(id);
+ return ui->lwFiles->item(id)->text();
+}
+QString qmpPlistWindow::getLastItem(bool a)
+{
+ if(ui->lwFiles->count()==0)return QString();
+ int id=ui->lwFiles->count()-1;
+ if(shuffle&&!a)id=rand()%ui->lwFiles->count();
ui->lwFiles->setCurrentRow(id);
return ui->lwFiles->item(id)->text();
}