summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2021-03-28 22:51:33 +0200
committerGitHub <noreply@github.com>2021-03-28 22:51:33 +0200
commit7c519a50ef16d3d5f1515825fdd63129ab68f6fd (patch)
tree92df1c80a042748e984b7ba8566145e8a0c4d0bb
parent718356d07c040b28140a571b4e0983ed2c0e2258 (diff)
parent4cada2551e82efa55635331d60adec3cf5300b8c (diff)
Merge pull request #3752 from Holzhaus/hss1394-warnings
Fix Hss1394Controller warnings
-rw-r--r--src/controllers/midi/hss1394controller.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/controllers/midi/hss1394controller.cpp b/src/controllers/midi/hss1394controller.cpp
index 0802e7f248..01a74286d1 100644
--- a/src/controllers/midi/hss1394controller.cpp
+++ b/src/controllers/midi/hss1394controller.cpp
@@ -22,8 +22,6 @@ void DeviceChannelListener::Process(const hss1394::uint8 *pBuffer, hss1394::uint
// If multiple three-byte messages arrive right next to each other, handle them all
while (i < uBufferSize) {
unsigned char status = pBuffer[i];
- unsigned char opcode = status & 0xF0;
- unsigned char channel = status & 0x0F;
unsigned char note;
unsigned char velocity;
switch (status & 0xF0) {
@@ -188,7 +186,7 @@ int Hss1394Controller::close() {
void Hss1394Controller::sendShortMsg(unsigned char status, unsigned char byte1,
unsigned char byte2) {
- unsigned char data[3] = { status, byte1, byte2 };
+ const unsigned char data[3] = {status, byte1, byte2};
int bytesSent = m_pChannel->SendChannelBytes(data, 3);
controllerDebug(MidiUtils::formatMidiMessage(getName(),
@@ -196,19 +194,19 @@ void Hss1394Controller::sendShortMsg(unsigned char status, unsigned char byte1,
MidiUtils::channelFromStatus(status),
MidiUtils::opCodeFromStatus(status)));
- //if (bytesSent != 3) {
- // qDebug()<<"ERROR: Sent" << bytesSent << "of 3 bytes:" << message;
- // //m_pChannel->Flush();
- //}
+ if (bytesSent != 3) {
+ qWarning() << "Sent" << bytesSent << "of 3 bytes:" << status << byte1 << byte2;
+ //m_pChannel->Flush();
+ }
}
void Hss1394Controller::send(const QByteArray& data) {
- int bytesSent = m_pChannel->SendChannelBytes(
- (unsigned char*)data.constData(), data.size());
+ const int bytesSent = m_pChannel->SendChannelBytes(
+ reinterpret_cast<const unsigned char*>(data.constData()), data.size());
controllerDebug(MidiUtils::formatSysexMessage(getName(), data));
- //if (bytesSent != length) {
- // qDebug()<<"ERROR: Sent" << bytesSent << "of" << length << "bytes (SysEx)";
- // //m_pChannel->Flush();
- //}
+ if (bytesSent != data.size()) {
+ qWarning() << "Sent" << bytesSent << "of" << data.size() << "bytes (SysEx)";
+ //m_pChannel->Flush();
+ }
}