aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpmainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-27 23:45:24 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-27 23:45:24 +0800
commit8eac5088101595422753030b1b259411d63f83a8 (patch)
tree43c4c3e9b92657bbf6c7c55cf75d297ec85a5b7f /qmidiplayer-desktop/qmpmainwindow.cpp
parentdfcc193d4070c99bf217ac74a492160968dba766 (diff)
downloadQMidiPlayer-8eac5088101595422753030b1b259411d63f83a8.tar.xz
Handle pitch bend in visualization.
Handle mute and solo in the default visualization. Show file name in window title. A little plugin sdk documentaion... Remove stupid things.
Diffstat (limited to 'qmidiplayer-desktop/qmpmainwindow.cpp')
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp
index 53a2031..58b28b7 100644
--- a/qmidiplayer-desktop/qmpmainwindow.cpp
+++ b/qmidiplayer-desktop/qmpmainwindow.cpp
@@ -4,6 +4,7 @@
#include <QFileInfo>
#include <QMimeData>
#include <QFont>
+#include <QTextCodec>
#include <QDirIterator>
#include <QDesktopWidget>
#include <QMessageBox>
@@ -240,7 +241,7 @@ void qmpMainWindow::updateWidgets()
for(int i=0;i<16;++i)if(VIs[i])VIs[i]->stop();
if(singleFS)player->playerPanic(true);
chnlw->on_pbUnmute_clicked();chnlw->on_pbUnsolo_clicked();
- QString fns=plistw->getNextItem();
+ QString fns=plistw->getNextItem();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('.')));
onfnChanged();
LOAD_FILE;
@@ -296,6 +297,14 @@ void qmpMainWindow::updateWidgets()
}
QString qmpMainWindow::getFileName(){return ui->lbFileName->text();}
+std::string qmpMainWindow::getTitle()
+{
+ if(!qmpSettingsWindow::getSettingsIntf())return "";
+ return QTextCodec::codecForName(
+ qmpSettingsWindow::getSettingsIntf()->value("Midi/TextEncoding","").
+ toString().toStdString().c_str())->
+ toUnicode(player->getTitle()).toStdString();
+}
void qmpMainWindow::playerSetup()
{
@@ -343,7 +352,7 @@ void qmpMainWindow::on_pbPlayPause_clicked()
plistw->on_pbAdd_clicked();
fns=plistw->getFirstItem();
if(!fns.length())return(void)(playing=false);
- }
+ }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('.')));
onfnChanged();
LOAD_FILE;
@@ -473,6 +482,7 @@ void qmpMainWindow::on_pbPrev_clicked()
for(int i=0;i<16;++i)if(VIs[i])VIs[i]->stop();
ui->hsTimer->setValue(0);chnlw->on_pbUnmute_clicked();chnlw->on_pbUnsolo_clicked();
QString fns=plistw->getPrevItem();if(fns.length()==0)return on_pbStop_clicked();
+ 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('.')));
onfnChanged();
LOAD_FILE;
@@ -502,6 +512,7 @@ void qmpMainWindow::on_pbNext_clicked()
ui->hsTimer->setValue(0);chnlw->on_pbUnmute_clicked();chnlw->on_pbUnsolo_clicked();
QString fns=plistw->getNextItem();if(fns.length()==0)return on_pbStop_clicked();
ui->lbFileName->setText(QUrl::fromLocalFile(fns).fileName().left(QUrl::fromLocalFile(fns).fileName().lastIndexOf('.')));
+ setWindowTitle(QUrl::fromLocalFile(fns).fileName().left(QUrl::fromLocalFile(fns).fileName().lastIndexOf('.'))+" - QMidiPlayer");
onfnChanged();
LOAD_FILE;
char ts[100];
@@ -533,6 +544,7 @@ void qmpMainWindow::selectionChanged()
chnlw->on_pbUnmute_clicked();chnlw->on_pbUnsolo_clicked();
QString fns=plistw->getSelectedItem();
ui->lbFileName->setText(QUrl::fromLocalFile(fns).fileName().left(QUrl::fromLocalFile(fns).fileName().lastIndexOf('.')));
+ setWindowTitle(QUrl::fromLocalFile(fns).fileName().left(QUrl::fromLocalFile(fns).fileName().lastIndexOf('.'))+" - QMidiPlayer");
onfnChanged();
LOAD_FILE;
char ts[100];