From 25794c23e201e119134ebbd2bcc5236d8edc77ca Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sun, 6 Nov 2005 01:23:40 +0000 Subject: Default to /dev/sequencer before /dev/null if no MIDI device is specified. svn-id: r19480 --- backends/midi/seq.cpp | 16 +++++++++++----- 1 file 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) "); -- cgit v1.2.3