aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpchannelswindow.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2023-11-26 21:29:16 -0500
committerGravatar Chris Xiong <chirs241097@gmail.com> 2023-11-26 21:29:16 -0500
commitf7def0d883fa5cab62ef61b40b9f857245be8e6c (patch)
treed29322dd4be6e98c0740ae6df4dc70eb41614a76 /qmidiplayer-desktop/qmpchannelswindow.cpp
parent60989e52b3f3bc0a95d3e61bd8e59fa4d9b7ab83 (diff)
downloadQMidiPlayer-f7def0d883fa5cab62ef61b40b9f857245be8e6c.tar.xz
Initial Qt 6 port. Many bug fixes.
Diffstat (limited to 'qmidiplayer-desktop/qmpchannelswindow.cpp')
-rw-r--r--qmidiplayer-desktop/qmpchannelswindow.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp
index 8957254..7743084 100644
--- a/qmidiplayer-desktop/qmpchannelswindow.cpp
+++ b/qmidiplayer-desktop/qmpchannelswindow.cpp
@@ -1,5 +1,4 @@
#include <cstdio>
-#include <functional>
#include <set>
#include <QCheckBox>
#include <QPushButton>
@@ -14,23 +13,16 @@ qmpChannelsModel::qmpChannelsModel(QObject *parent): QAbstractTableModel(parent)
evh = qmpMainWindow::getInstance()->getPlayer()->registerEventHandler(
[this](const void *_e, void *)
{
+ const SEvent *e = (const SEvent *)(_e);
+ if ((e->type & 0xF0) == 0xC0)
+ emit dataChanged(index(e->type & 0x0F, 4), index(e->type & 0x0F, 4), {Qt::ItemDataRole::DisplayRole});
if (!updatequeued)
{
updatequeued = true;
- const SEvent *e = (const SEvent *)(_e);
- if ((e->p1 & 0xF0) == 0xC0)
- emit dataChanged(index(e->p1 & 0xF0, 4), index(e->p1 & 0xF0, 4), {Qt::ItemDataRole::DisplayRole});
QMetaObject::invokeMethod(this, &qmpChannelsModel::updateChannelActivity, Qt::ConnectionType::QueuedConnection);
}
}
, nullptr, false);
- QTimer *t = new QTimer(this);
- t->setInterval(500);
- t->setSingleShot(false);
- connect(t, &QTimer::timeout, [this]()
- {
- emit this->dataChanged(this->index(0, 4), this->index(15, 4), {Qt::ItemDataRole::DisplayRole});
- });
memset(mute, 0, sizeof(mute));
memset(solo, 0, sizeof(solo));
}