From d5207ed6eada110c13309fa6bffb178f41c1d365 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 29 Apr 2011 11:47:49 +0200 Subject: fix AmigaOS 4 build (thanks to Raziel^) --- backends/midi/camd.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'backends/midi/camd.cpp') diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp index ee3baaadd2..9909cb00cf 100644 --- a/backends/midi/camd.cpp +++ b/backends/midi/camd.cpp @@ -29,6 +29,8 @@ #if defined(__amigaos4__) +#include "common/textconsole.h" +#include "common/error.h" #include "common/endian.h" #include "common/util.h" #include "audio/musicplugin.h" -- cgit v1.2.3 From 79b45cf53500297e1365d78612ce7e4d1d18e204 Mon Sep 17 00:00:00 2001 From: Hubert Maier Date: Fri, 29 Apr 2011 14:05:21 +0300 Subject: AMIGAOS: Fix CAMD compiler warning --- backends/midi/camd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/midi/camd.cpp') diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp index 9909cb00cf..cc791cf7c0 100644 --- a/backends/midi/camd.cpp +++ b/backends/midi/camd.cpp @@ -137,8 +137,8 @@ void MidiDriver_CAMD::sysEx(const byte *msg, uint16 length) { char *MidiDriver_CAMD::getDevice() { char *retname = NULL; - APTR key; - if (key = _ICamd->LockCAMD(CD_Linkages)) { + APTR key = _ICamd->LockCAMD(CD_Linkages); + if (key != NULL) { struct MidiCluster *cluster = _ICamd->NextCluster(NULL); while (cluster && !retname) { -- cgit v1.2.3 From 3e8a7afeae15f0a6d804d8092ccec2bea7a1a2f3 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sun, 8 May 2011 13:06:10 +0200 Subject: CAMD: Added _isOpen checks to send() and sysEx() At Raziel^'s request. This is the same as the ALSA checks I added earlier today. --- backends/midi/camd.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'backends/midi/camd.cpp') diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp index cc791cf7c0..aafc7347f0 100644 --- a/backends/midi/camd.cpp +++ b/backends/midi/camd.cpp @@ -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)); -- cgit v1.2.3