#7919 closed patch
Linux raw midi device support
Reported by: | SF/chuzwuzza | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | Port: Linux |
Version: | Keywords: | ||
Cc: | Game: |
Description
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)
Change History (8)
by , 23 years ago
Attachment: | rawmidi.patch added |
---|
comment:1 by , 23 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 , 23 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;
+}
comment:3 by , 23 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:5 by , 23 years ago
Status: | new → closed |
---|
comment:6 by , 6 years ago
Component: | → Port: Linux |
---|
rawmidi patch