aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-06-03 23:18:34 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-06-03 23:18:34 +0800
commitad3566b5c5d1e0af5f4e9e33e7d863f2bac7e447 (patch)
tree8591218941f6a8a7b6b745abbeadcc442138bffb
parent8aa8574504acdab46ee378d9c6eaaf3f641c2bac (diff)
downloadQMidiPlayer-ad3566b5c5d1e0af5f4e9e33e7d863f2bac7e447.tar.xz
Add the "restart fluidsynth" action.
-rw-r--r--ChangeLog3
-rw-r--r--doc/mainwindow.html4
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.cpp17
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.hpp3
4 files changed, 24 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 86085ab..9cfc81b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2016-06-03 0.8.2 alpha
+Add the "restart fluidsynth" action.
+
2016-06-02 0.8.2 alpha
Add option to change note colors.
diff --git a/doc/mainwindow.html b/doc/mainwindow.html
index 02307fe..e576e7b 100644
--- a/doc/mainwindow.html
+++ b/doc/mainwindow.html
@@ -47,6 +47,10 @@
MIDI mapping does not apply to render results.</li>
<li>Panic.<br>
If somehow the player messed up, use this action to turn off all the notes.
+ <li>Restart fluidsynth.<br>
+ It's not possible to use this action unless the player is stopped.<br>
+ Applies settings and restart the internel fluidsynth engine when "single fluidsynth instance"
+ is enabled.
</li>
</ul>
<br><a href="index.html">Return</a>
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp
index aaca753..48dd531 100644
--- a/qmidiplayer-desktop/qmpmainwindow.cpp
+++ b/qmidiplayer-desktop/qmpmainwindow.cpp
@@ -92,9 +92,11 @@ void qmpMainWindow::init()
fnA1=new QAction(tr("File Information"),ui->lbFileName);
fnA2=new QAction(tr("Render to Wave"),ui->lbFileName);
fnA3=new QAction(tr("Panic"),ui->lbFileName);
+ fnA4=new QAction(tr("Restart fluidsynth"),ui->lbFileName);
ui->lbFileName->addAction(fnA1);
ui->lbFileName->addAction(fnA2);
ui->lbFileName->addAction(fnA3);
+ ui->lbFileName->addAction(fnA4);
pmgr->scanPlugins();settingsw->updatePluginList(pmgr);pmgr->initPlugins();
if(singleFS){player->fluidPreInitialize();playerSetup();player->fluidInitialize();
for(int i=settingsw->getSFWidget()->rowCount()-1;i>=0;--i){if(!((QCheckBox*)settingsw->getSFWidget()->cellWidget(i,0))->isChecked())continue;
@@ -119,6 +121,7 @@ void qmpMainWindow::init()
connect(fnA1,SIGNAL(triggered()),this,SLOT(onfnA1()));
connect(fnA2,SIGNAL(triggered()),this,SLOT(onfnA2()));
connect(fnA3,SIGNAL(triggered()),this,SLOT(onfnA3()));
+ connect(fnA4,SIGNAL(triggered()),this,SLOT(onfnA4()));
connect(timer,SIGNAL(timeout()),this,SLOT(updateWidgets()));
connect(timer,SIGNAL(timeout()),chnlw,SLOT(channelWindowsUpdate()));
connect(timer,SIGNAL(timeout()),infow,SLOT(updateInfo()));
@@ -227,13 +230,15 @@ void qmpMainWindow::dragEnterEvent(QDragEnterEvent *event)
void qmpMainWindow::updateWidgets()
{
fnA2->setEnabled(stopped);
+ fnA4->setEnabled(stopped);
if(player->isFinished()&&playerTh)
{
if(!plistw->getRepeat())
{
timer->stop();stopped=true;playing=false;
for(int i=0;i<16;++i)if(VIs[i])VIs[i]->stop();
- fnA2->setEnabled(stopped);chnlw->resetAcitivity();
+ fnA2->setEnabled(stopped);
+ fnA4->setEnabled(stopped);chnlw->resetAcitivity();
player->playerDeinit();playerTh->join();
delete playerTh;playerTh=NULL;
if(singleFS)player->playerPanic(true);
@@ -480,7 +485,7 @@ void qmpMainWindow::on_pbStop_clicked()
{
timer->stop();stopped=true;playing=false;
for(int i=0;i<16;++i)if(VIs[i])VIs[i]->stop();
- player->playerDeinit();fnA2->setEnabled(stopped);
+ player->playerDeinit();fnA2->setEnabled(stopped);fnA4->setEnabled(stopped);
if(singleFS)player->playerPanic(true);chnlw->resetAcitivity();
if(playerTh){playerTh->join();delete playerTh;playerTh=NULL;}
chnlw->on_pbUnmute_clicked();chnlw->on_pbUnsolo_clicked();
@@ -697,6 +702,14 @@ void qmpMainWindow::onfnA3()
player->playerPanic();
}
+void qmpMainWindow::onfnA4()
+{
+ player->fluidDeinitialize();player->fluidPreInitialize();playerSetup();player->fluidInitialize();
+ for(int i=settingsw->getSFWidget()->rowCount()-1;i>=0;--i){if(!((QCheckBox*)settingsw->getSFWidget()->cellWidget(i,0))->isChecked())continue;
+ LOAD_SOUNDFONT;
+ }
+}
+
void qmpMainWindow::on_pbSettings_clicked()
{
if(ui->pbSettings->isChecked())settingsw->show();else settingsw->close();
diff --git a/qmidiplayer-desktop/qmpmainwindow.hpp b/qmidiplayer-desktop/qmpmainwindow.hpp
index 73bd109..8408409 100644
--- a/qmidiplayer-desktop/qmpmainwindow.hpp
+++ b/qmidiplayer-desktop/qmpmainwindow.hpp
@@ -88,6 +88,7 @@ class qmpMainWindow:public QMainWindow
void onfnA1();
void onfnA2();
void onfnA3();
+ void onfnA4();
void on_pushButton_clicked();
@@ -115,7 +116,7 @@ class qmpMainWindow:public QMainWindow
QPointer<qmpHelpWindow> helpw;
qmpVisualizationIntf* VIs[16];
- QAction *fnA1,*fnA2,*fnA3;
+ QAction *fnA1,*fnA2,*fnA3,*fnA4;
void onfnChanged();
void playerSetup();