Opened 19 years ago

Closed 18 years ago

Last modified 21 months ago

#7919 closed patch

Linux raw midi device support

Reported by: SF/chuzwuzza Owned by:
Priority: normal Component: Port: Linux
Keywords: Cc:


This patch allows support for raw midi devices (/dev/midi) in unix. You can enable it with -DUSE_RAWMIDI and then set the environment variable SCUMMVM_MIDI to /dev/midi or wherever. (also some updates for teh readme ;)

Ticket imported from: #483461. Ticket imported from: patches/24.

Attachments (2)

rawmidi.patch (3.6 KB ) - added by SF/chuzwuzza 19 years ago.
rawmidi patch
rawmidi2.patch (3.9 KB ) - added by SF/chuzwuzza 19 years ago.
updated rawmidi patch

Download all attachments as: .zip

Change History (8)

by SF/chuzwuzza, 19 years ago

Attachment: rawmidi.patch added

rawmidi patch

comment:1 by SF/bbrox, 19 years ago

Well, just a comment that I updated a bit the patch after some discussions with Michael on IRC :-)

Now let's see if I can attach a new file....

comment:2 by SF/bbrox, 19 years ago

As I cannot attach a new file, the changes are in the function open_rawmidi_device that fixes some potential bugs :

+static int open_rawmidi_device() +{ + int device; + 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.txt) "); + } +
+ if ((device_name == NULL) || (device < 0)) { + if (device_name == NULL) + warning("Opening /dev/null (no music will be heard) "); + else + warning("Cannot open rawmidi device %s - using /dev/null (no music will be heard) ", device_name); + device = (open(("/dev/null"), O_RDWR, 0)); + if (device < 0) + error("Cannot open /dev/null to dump midi output"); + } + return device; +}

by SF/chuzwuzza, 19 years ago

Attachment: rawmidi2.patch added

updated rawmidi patch

comment:3 by SF/chuzwuzza, 19 years ago

I've attached a file which is the rawmidi patch with the changes bbrox suggested included. This one should be okay for committing

comment:4 by SF/ender, 18 years ago

Finally applied to CVS :P

comment:5 by SF/ender, 18 years ago

Status: newclosed

comment:6 by digitall, 21 months ago

Component: Port: Linux
Note: See TracTickets for help on using tickets.