aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/qmpmidiplay.cpp19
-rw-r--r--core/qmpmidiplay.hpp3
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.cpp9
3 files changed, 20 insertions, 11 deletions
diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp
index c3c52ca..113045f 100644
--- a/core/qmpmidiplay.cpp
+++ b/core/qmpmidiplay.cpp
@@ -189,7 +189,7 @@ SEvent *CMidiPlayer::getEvent(uint32_t id)
}
void CMidiPlayer::prePlayInit()
{
- playerPanic(true);
+ playerReset();
for (size_t i = 0; i < mididev.size(); ++i)
if (mididev[i].refcnt)
mididev[i].dev->reset(0xFF);
@@ -382,16 +382,21 @@ CMidiPlayer::~CMidiPlayer()
delete midiFile;
delete midiReaders;
}
-void CMidiPlayer::playerPanic(bool reset)
+void CMidiPlayer::playerReset()
{
for (auto &i : mididev)
if (i.refcnt)
{
- if (reset)
- i.dev->reset(0xff);
- else
- for (uint8_t j = 0; j < 16; ++j)
- i.dev->panic(j);
+ i.dev->reset(0xff);
+ }
+}
+void CMidiPlayer::playerPanic()
+{
+ for (auto &i : mididev)
+ if (i.refcnt)
+ {
+ for (uint8_t j = 0; j < 16; ++j)
+ i.dev->panic(j);
}
}
bool CMidiPlayer::playerLoadFile(const char *fn)
diff --git a/core/qmpmidiplay.hpp b/core/qmpmidiplay.hpp
index 56a26fd..03495b9 100644
--- a/core/qmpmidiplay.hpp
+++ b/core/qmpmidiplay.hpp
@@ -117,7 +117,8 @@ public:
void playerInit();
void playerDeinit();
void playerThread();
- void playerPanic(bool reset = false);
+ void playerReset();
+ void playerPanic();
//playing control methods
uint32_t getStamp(int id);
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp
index a139c20..a0a4539 100644
--- a/qmidiplayer-desktop/qmpmainwindow.cpp
+++ b/qmidiplayer-desktop/qmpmainwindow.cpp
@@ -284,7 +284,8 @@ void qmpMainWindow::updateWidgets()
}
delete playerTh;
playerTh = nullptr;
- player->playerPanic(true);
+ player->playerPanic();
+ player->playerReset();
chnlw->on_pbUnmute_clicked();
chnlw->on_pbUnsolo_clicked();
ui->pbPlayPause->setIcon(QIcon(getThemedIcon(":/img/play.svg")));
@@ -355,7 +356,8 @@ void qmpMainWindow::switchTrack(QString s, bool interrupt)
playerTh = nullptr;
}
timer->stop();
- player->playerPanic(true);
+ player->playerPanic();
+ player->playerReset();
ui->hsTimer->setValue(0);
chnlw->on_pbUnmute_clicked();
chnlw->on_pbUnsolo_clicked();
@@ -669,7 +671,8 @@ void qmpMainWindow::on_pbStop_clicked()
player->playerDeinit();
setFuncEnabled("Render", stopped);
setFuncEnabled("ReloadSynth", stopped);
- player->playerPanic(true);
+ player->playerPanic();
+ player->playerReset();
if (playerTh)
{
playerTh->join();