Skip to content

Commit

Permalink
CAMD: Added _isOpen checks to send() and sysEx()
Browse files Browse the repository at this point in the history
At Raziel^'s request. This is the same as the ALSA checks I added
earlier today.
  • Loading branch information
eriktorbjorn committed May 8, 2011
1 parent d4e4148 commit 3e8a7af
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backends/midi/camd.cpp
Expand Up @@ -116,11 +116,21 @@ void MidiDriver_CAMD::close() {
}

void MidiDriver_CAMD::send(uint32 b) {
if (!_isOpen) {
warning("MidiDriver_CAMD: Got event while not open");
return;
}

ULONG data = READ_LE_UINT32(&b);
_ICamd->PutMidi(_midi_link, data);
}

void MidiDriver_CAMD::sysEx(const byte *msg, uint16 length) {
if (!_isOpen) {
warning("MidiDriver_CAMD: Got SysEx while not open");
return;
}

unsigned char buf[266];

assert(length + 2 <= ARRAYSIZE(buf));
Expand Down

0 comments on commit 3e8a7af

Please sign in to comment.