Skip to content

Commit

Permalink
document purpose of seemingly useless parameter
Browse files Browse the repository at this point in the history
and fix some spacing
  • Loading branch information
Be-ing committed Sep 10, 2016
1 parent 653136a commit 047de0b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/controllers/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ void Controller::send(QList<int> data, unsigned int length) {
// If you change this implementation, also change it in HidController (That
// function is required due to HID devices having report IDs)

// The length parameter is here for backwards compatibility for when scripts
// were required to specify it.
length = data.size();
QByteArray msg(length, 0);
for (unsigned int i = 0; i < length; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/midi/hss1394controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ int Hss1394Controller::close() {
}

void Hss1394Controller::sendShortMsg(unsigned char status, unsigned char byte1,
unsigned char byte2) {
unsigned char byte2) {
unsigned char data[3] = { status, byte1, byte2 };

int bytesSent = m_pChannel->SendChannelBytes(data, 3);
Expand Down
12 changes: 7 additions & 5 deletions src/controllers/midi/portmidicontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,14 @@ void PortMidiController::sendShortMsg(unsigned char status, unsigned char byte1,

PmError err = m_pOutputDevice->writeShort(word);
if (err == pmNoError) {
controllerDebug(formatMidiMessage(getName(),
status, byte1, byte2,
MidiUtils::channelFromStatus(status), MidiUtils::opCodeFromStatus(status)));
controllerDebug(formatMidiMessage(getName(),
status, byte1, byte2,
MidiUtils::channelFromStatus(status),
MidiUtils::opCodeFromStatus(status)));
} else {
qWarning() << "Error sending short message"
<< formatMidiMessage(getName(), status, byte1, byte2,
<< formatMidiMessage(getName(),
status, byte1, byte2,
MidiUtils::channelFromStatus(status),
MidiUtils::opCodeFromStatus(status))
<< "\nPortMidi error:" << Pm_GetErrorText(err);
Expand All @@ -243,7 +245,7 @@ void PortMidiController::send(QByteArray data) {

PmError err = m_pOutputDevice->writeSysEx((unsigned char*)data.constData());
if (err == pmNoError) {
controllerDebug(formatSysexMessage(getName(), data));
controllerDebug(formatSysexMessage(getName(), data));
} else {
qWarning() << "PortMidi sendSysexMsg error:"
<< Pm_GetErrorText(err);
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/midi/portmidicontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class PortMidiController : public MidiController {

private:
void sendShortMsg(unsigned char status, unsigned char byte1,
unsigned char byte2);
unsigned char byte2);
// The sysex data must already contain the start byte 0xf0 and the end byte
// 0xf7.
void send(QByteArray data);
Expand Down

0 comments on commit 047de0b

Please sign in to comment.