aboutsummaryrefslogtreecommitdiff
path: root/sound/mididrv.cpp
diff options
context:
space:
mode:
authorJames Brown2002-05-12 09:21:27 +0000
committerJames Brown2002-05-12 09:21:27 +0000
commitb9e335ef0fc1639bedc9a5f1482d7ad65d603ff2 (patch)
treeccfa03952e12f0e68098ae19174c3a1a3ef5c389 /sound/mididrv.cpp
parent7b8a4f59274cfe333b2fb7aa1f7ac46337c38d0b (diff)
downloadscummvm-rg350-b9e335ef0fc1639bedc9a5f1482d7ad65d603ff2.tar.gz
scummvm-rg350-b9e335ef0fc1639bedc9a5f1482d7ad65d603ff2.tar.bz2
scummvm-rg350-b9e335ef0fc1639bedc9a5f1482d7ad65d603ff2.zip
Add new MIDIPORT parameter to solve Linux sequencer issues.
svn-id: r4285
Diffstat (limited to 'sound/mididrv.cpp')
-rw-r--r--sound/mididrv.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp
index 0dd821d253..11c549b6af 100644
--- a/sound/mididrv.cpp
+++ b/sound/mididrv.cpp
@@ -340,7 +340,6 @@ MidiDriver *MidiDriver_AMIDI_create() {
#if defined(UNIX) && !defined(__BEOS__)
#define SEQ_MIDIPUTC 5
#define SPECIAL_CHANNEL 9
-#define DEVICE_NUM 1
class MidiDriver_SEQ : public MidiDriver {
public:
@@ -355,12 +354,13 @@ private:
StreamCallback *_stream_proc;
void *_stream_param;
int _mode;
- int device;
+ int device, _device_num;
};
MidiDriver_SEQ::MidiDriver_SEQ(){
_mode=0;
device=0;
+ _device_num=0;
}
int MidiDriver_SEQ::open(int mode) {
@@ -386,6 +386,7 @@ int MidiDriver_SEQ::open(int mode) {
error("Cannot open /dev/null to dump midi output");
}
+ _device_num = atoi(getenv("SCUMMVM_MIDIPORT"));
return 0;
}
@@ -408,26 +409,26 @@ void MidiDriver_SEQ::send(uint32 b)
case 0xE0:
buf[position++] = SEQ_MIDIPUTC;
buf[position++] = (unsigned char)b;
- buf[position++] = DEVICE_NUM;
+ buf[position++] = _device_num;
buf[position++] = 0;
buf[position++] = SEQ_MIDIPUTC;
buf[position++] = (unsigned char)((b >> 8) & 0x7F);
- buf[position++] = DEVICE_NUM;
+ buf[position++] = _device_num;
buf[position++] = 0;
buf[position++] = SEQ_MIDIPUTC;
buf[position++] = (unsigned char)((b >> 16) & 0x7F);
- buf[position++] = DEVICE_NUM;
+ buf[position++] = _device_num;
buf[position++] = 0;
break;
case 0xC0:
case 0xD0:
buf[position++] = SEQ_MIDIPUTC;
buf[position++] = (unsigned char)b;
- buf[position++] = DEVICE_NUM;
+ buf[position++] = _device_num;
buf[position++] = 0;
buf[position++] = SEQ_MIDIPUTC;
buf[position++] = (unsigned char)((b >> 8) & 0x7F);
- buf[position++] = DEVICE_NUM;
+ buf[position++] = _device_num;
buf[position++] = 0;
break;
default: