aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray2005-11-06 01:23:40 +0000
committerJonathan Gray2005-11-06 01:23:40 +0000
commit25794c23e201e119134ebbd2bcc5236d8edc77ca (patch)
treebb28d21bae72a387529c6f4eb24d28cf3786c890
parentb01bb6335fef8d6b957987651ed4cf2c613717d1 (diff)
downloadscummvm-rg350-25794c23e201e119134ebbd2bcc5236d8edc77ca.tar.gz
scummvm-rg350-25794c23e201e119134ebbd2bcc5236d8edc77ca.tar.bz2
scummvm-rg350-25794c23e201e119134ebbd2bcc5236d8edc77ca.zip
Default to /dev/sequencer before /dev/null if no MIDI device
is specified. svn-id: r19480
-rw-r--r--backends/midi/seq.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/backends/midi/seq.cpp b/backends/midi/seq.cpp
index d12cc97338..e84ee557d4 100644
--- a/backends/midi/seq.cpp
+++ b/backends/midi/seq.cpp
@@ -59,17 +59,23 @@ MidiDriver_SEQ::MidiDriver_SEQ() {
}
int MidiDriver_SEQ::open() {
+ char *device_name;
+ char dev_seq[] = "/dev/sequencer";
+
if (_isOpen)
return MERR_ALREADY_OPEN;
_isOpen = true;
device = 0;
- char *device_name = getenv("SCUMMVM_MIDI");
- if (device_name != NULL) {
- device = (::open((device_name), O_RDWR, 0));
- } else {
- warning("You need to set-up the SCUMMVM_MIDI environment variable properly (see README) ");
+ device_name = getenv("SCUMMVM_MIDI");
+
+ if (device_name == NULL) {
+ warning("SCUMMVM_MIDI environment variable not set, using /dev/sequencer");
+ device_name = dev_seq;
}
+
+ device = (::open((device_name), O_RDWR, 0));
+
if ((device_name == NULL) || (device < 0)) {
if (device_name == NULL)
warning("Opening /dev/null (no music will be heard) ");