aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop
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
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')
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.cpp16
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.hpp1
-rw-r--r--qmidiplayer-desktop/qmpplugin.cpp13
-rw-r--r--qmidiplayer-desktop/qmpplugin.hpp1
-rw-r--r--qmidiplayer-desktop/qmpsettingswindow.cpp2
5 files changed, 30 insertions, 3 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];
diff --git a/qmidiplayer-desktop/qmpmainwindow.hpp b/qmidiplayer-desktop/qmpmainwindow.hpp
index a981559..bf55fb9 100644
--- a/qmidiplayer-desktop/qmpmainwindow.hpp
+++ b/qmidiplayer-desktop/qmpmainwindow.hpp
@@ -62,6 +62,7 @@ class qmpMainWindow:public QMainWindow
QTimer* getTimer(){return timer;}
bool isFinalizing(){return fin;}
QString getFileName();
+ std::string getTitle();
int pharseArgs();
int registerVisualizationIntf(qmpVisualizationIntf* intf);
void unregisterVisualizationIntf(int handle);
diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp
index a71b869..837f4db 100644
--- a/qmidiplayer-desktop/qmpplugin.cpp
+++ b/qmidiplayer-desktop/qmpplugin.cpp
@@ -13,6 +13,12 @@ qmpPluginAPI pluginAPI;
qmpMainWindow* qmw;
qmpSettingsWindow* qsw;
#ifdef _WIN32
+void qmpPluginManager::scanPlugins()
+{
+ HANDLE dir;
+ std::vector<std::string> cpluginpaths;
+ //FindFirstFile, FindNextFile, FindClose
+}
#else
void qmpPluginManager::scanPlugins()
{
@@ -86,6 +92,13 @@ uint32_t qmpPluginAPI::getMaxPolyphone()
{return qmw&&qmw->getPlayer()?qmw->getPlayer()->getMaxPolyphone():0;}
uint32_t qmpPluginAPI::getCurrentTimeStamp()
{return qmw&&qmw->getPlayer()?qmw->getPlayer()->getTick():0;}
+double qmpPluginAPI::getPitchBend(int ch)
+{return qmw&&qmw->getPlayer()?qmw->getPlayer()->getPitchBend(ch):0;}
+bool qmpPluginAPI::getChannelMask(int ch)
+{return qmw&&qmw->getPlayer()?qmw->getPlayer()->getChannelMask(ch):false;}
+std::string qmpPluginAPI::getTitle()
+{return qmw?qmw->getTitle():"";}
+
int qmpPluginAPI::registerEventHandlerIntf(IMidiCallBack *cb,void *userdata)
{return qmw->getPlayer()->setEventHandlerCB(cb,userdata);}
void qmpPluginAPI::unregisterEventHandlerIntf(int intfhandle)
diff --git a/qmidiplayer-desktop/qmpplugin.hpp b/qmidiplayer-desktop/qmpplugin.hpp
index 8d14596..81a16a7 100644
--- a/qmidiplayer-desktop/qmpplugin.hpp
+++ b/qmidiplayer-desktop/qmpplugin.hpp
@@ -1,5 +1,6 @@
#ifndef QMPPLUGIN_H
#define QMPPLUGIN_H
+#define QMP_MAIN
#include <string>
#include <vector>
#include "../include/qmpcorepublic.hpp"
diff --git a/qmidiplayer-desktop/qmpsettingswindow.cpp b/qmidiplayer-desktop/qmpsettingswindow.cpp
index 2e6af6d..985fb6e 100644
--- a/qmidiplayer-desktop/qmpsettingswindow.cpp
+++ b/qmidiplayer-desktop/qmpsettingswindow.cpp
@@ -25,7 +25,7 @@ qmpSettingsWindow::qmpSettingsWindow(QWidget *parent) :
qmpSettingsWindow::~qmpSettingsWindow()
{
- delete settings;
+ delete settings;settings=NULL;
delete ui;
}