From 5f685836d9d0be09801c0829878705d119cda964 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Sat, 27 Mar 2021 12:19:58 +0100 Subject: Hss1394Controller: Remove unused variables --- src/controllers/midi/hss1394controller.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/controllers/midi/hss1394controller.cpp b/src/controllers/midi/hss1394controller.cpp index 0802e7f248..d89268d644 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) { -- cgit v1.2.3 From 611bb1c7be1278b144570e92dc70b1af987b010a Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Sat, 27 Mar 2021 12:22:01 +0100 Subject: Hss1394Controller: Print Warning if not all bytes were sent --- src/controllers/midi/hss1394controller.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/controllers/midi/hss1394controller.cpp b/src/controllers/midi/hss1394controller.cpp index d89268d644..3512f58e33 100644 --- a/src/controllers/midi/hss1394controller.cpp +++ b/src/controllers/midi/hss1394controller.cpp @@ -186,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(), @@ -194,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) { + qDebug() << "ERROR: 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(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()) { + qDebug() << "ERROR: Sent" << bytesSent << "of" << data.size() << "bytes (SysEx)"; + //m_pChannel->Flush(); + } } -- cgit v1.2.3 From 4cada2551e82efa55635331d60adec3cf5300b8c Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Sun, 28 Mar 2021 21:23:36 +0200 Subject: Hss1394Controller: Increate log level severity to Warning --- src/controllers/midi/hss1394controller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/midi/hss1394controller.cpp b/src/controllers/midi/hss1394controller.cpp index 3512f58e33..01a74286d1 100644 --- a/src/controllers/midi/hss1394controller.cpp +++ b/src/controllers/midi/hss1394controller.cpp @@ -195,7 +195,7 @@ void Hss1394Controller::sendShortMsg(unsigned char status, unsigned char byte1, MidiUtils::opCodeFromStatus(status))); if (bytesSent != 3) { - qDebug() << "ERROR: Sent" << bytesSent << "of 3 bytes:" << status << byte1 << byte2; + qWarning() << "Sent" << bytesSent << "of 3 bytes:" << status << byte1 << byte2; //m_pChannel->Flush(); } } @@ -206,7 +206,7 @@ void Hss1394Controller::send(const QByteArray& data) { controllerDebug(MidiUtils::formatSysexMessage(getName(), data)); if (bytesSent != data.size()) { - qDebug() << "ERROR: Sent" << bytesSent << "of" << data.size() << "bytes (SysEx)"; + qWarning() << "Sent" << bytesSent << "of" << data.size() << "bytes (SysEx)"; //m_pChannel->Flush(); } } -- cgit v1.2.3