Outgoing MIDI debugging messages#1004
Conversation
| unsigned char status, unsigned char control, | ||
| unsigned char value, unsigned char channel, | ||
| unsigned char opCode, mixxx::Duration timestamp) { | ||
| QString t; |
There was a problem hiding this comment.
Any suggestions for a better variable name here?
There was a problem hiding this comment.
Not really. .. "msg2" or something that is not "time" related .
bc410d9 to
6490153
Compare
and fix some spacing
6490153 to
047de0b
Compare
|
For reference, the HSS1394 library code is available here: https://launchpad.net/hss1394 |
| private: | ||
| void sendWord(unsigned int word); | ||
| void sendShortMsg(unsigned char status, unsigned char byte1, | ||
| unsigned char byte2); |
There was a problem hiding this comment.
What gain is there in eliminating the ability to send data words?
There was a problem hiding this comment.
The way it was before, with sendShortMsg() passing the computed word to sendWord(), the sendWord() function that actually did the sending would have to undo the operations of sendShortMsg() to print the three separate MIDI bytes.
https://github.com/mixxxdj/mixxx/pull/1004/files#diff-0212d99488d889be2b8194be8f10eed0R178
There was a problem hiding this comment.
That may be the case in HSS1394Controller, but not in PortMidiController. https://github.com/mixxxdj/mixxx/pull/1004/files#diff-ab47417f917c4a5cea304eded0d68381R213
I guess it doesn't much matter since there's no engine.sendWord() function for scripts.
and minor code formatting
| unsigned char status, unsigned char control, | ||
| unsigned char value, unsigned char channel, | ||
| unsigned char opCode, mixxx::Duration timestamp) { | ||
| QString MidiController::formatMidiMessage(const QString& controllerName, |
There was a problem hiding this comment.
I'm curious why you've added the class name to the definitions. Isn't it implied?
There was a problem hiding this comment.
No, it isn't implied. That was actually confusing me for a bit before I got help in ##c++-basic on Freenode. I was getting a linker error when I added it to the class as a protected member function but didn't add the class name to the definition.
There was a problem hiding this comment.
How were you able to build before then?
There was a problem hiding this comment.
It wasn't in the header. It was only defined in the .cpp file, but I had to make it a protected member of the class to reuse it in PortMidiController::sendShortMsg() and Hss1394Controller::sendShortMsg().
There was a problem hiding this comment.
Nit: since formatMidiMessage/formatSysexMessage don't use any member variables/methods of MidiController, they could move to MidiUtils (src/controllers/midi/midiutils.h). Would be cleaner that way.
|
@Pegasus-RPG can you test that this hasn't broken anything for HSS1394 controllers? |
|
I can, but it may be a few days. In the meantime, can you create test fixtures that create virtual HSS1394 controllers and I'll populate them with MIDI data and expected results? (I'm still new to creating tests.) |
|
I'll look into it, but a lot of the PortMidiController tests are segfaulting on my system (on this branch and master), so I'm not sure I'll figure out how to set it up right. I did notice Travis is having trouble compiling tests on this branch, so I'll look into that as well. |
rryan
left a comment
There was a problem hiding this comment.
This will be a big help for script authors, thanks for working on it.
RE: HSS1394, this looks like a safe change to me.
| status, byte1, byte2, | ||
| MidiUtils::channelFromStatus(status), | ||
| MidiUtils::opCodeFromStatus(status)) | ||
| << "\nPortMidi error:" << Pm_GetErrorText(err); |
There was a problem hiding this comment.
On Windows it's \r\n. Instead I would either keep them on the same line or make a separate qWarning if you want it on a separate line (I don't think QtDebug supports std::endl).
| if (err == pmNoError) { | ||
| controllerDebug(formatSysexMessage(getName(), data)); | ||
| } else { | ||
| qWarning() << "PortMidi sendSysexMsg error:" |
There was a problem hiding this comment.
Do you want to print the formatted message on error here too?
| // 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 |
There was a problem hiding this comment.
I think we should also mention this in the header definition of send() and belongs in the header at the definition of Controller::send and MidiController::sendSysexMessage.
|
Thanks for reviewing. I'll get back to work on this in a bit after the new effects interface and Deere redesign. |
… to MidiUtils plus miscellaneous small fixes
336b978 to
6e8b4d0
Compare
|
Merge conflicts resolved. |
463f34d to
4d708cd
Compare
|
Thanks, LGTM |
``--debugAssertBreak`` ``--logLevel`` ``--controllerDebug`` mixxxdj/mixxx#1265 mixxxdj/mixxx/mixxxdj#118 mixxxdj/mixxx#1004
implements https://bugs.launchpad.net/mixxx/+bug/1473695