i’ve been building a midi handling class, making use of the various JUCE midi classes, which provides a midi learn function.
however i’m not sure where the best place to place it in a project would be.
should the midi handling be a global thing? or should it live within a component as a member object? or should it actually be inherited into the parent object?
similarly, where should the midiinputcallback class be? at the moment it’s inherited into my MidiHandler class, but this class is not a visible component; if i wanted the callback to update a label on the gui i guess it would be more convenient to have the callback inherited into the parent component instead and send midi messages there (where it can easily use the message to update children components).
i’m just not sure what the safest approach should be.
also, i’m having a few problems with the MidiInput / MidiOutput port openings… sometimes it doesn’t get them, and VC++express says that it’s getting some errors from them. i’m not sure about threads or anything yet, but perhaps it’s something to do with that? they open most of the time, but sometimes when it’s running vc++e shows debug errors such as
First-chance exception at 0x7c90eb74 (ntdll.dll) in MCUTrigger.exe: 0xC0000008: An invalid handle was specified.
if something like midiox is already running then i don’t really get problems. is this thread related? some of the thread exit things say
The thread ‘mmGetCurrentTask’ (0x3b8) has exited with code 1 (0x1).
and i expect that that means an error? (code 0 is normal, right?)