[AD] [ alleg-Patches-1223015 ] load_midi RMI capability |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Patches item #1223015, was opened at 2005-06-18 02:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305665&aid=1223015&group_id=5665
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: DrV (i_am_drv)
Assigned to: Nobody/Anonymous (nobody)
Summary: load_midi RMI capability
Initial Comment:
Trivial modification to allow load_midi to read RMI
files (MIDI file within RIFF file); rejects non-RMID
RIFF files (i.e. WAV, etc.). No other changes to
existing functionality.
--- midi-orig.c 2005-04-02 18:46:20.000000000 +0000
+++ midi.c 2005-06-17 21:10:02.000000000 +0000
@@ -179,6 +179,25 @@
}
pack_fread(buf, 4, fp); /* read
midi header */
+
+ if (memcmp(buf, "RIFF", 4) == 0) { /* check
for RIFF header */
+ pack_mgetl(fp);
+
+ while (!pack_feof(fp)) {
+ pack_fread(buf, 4, fp); /* RMID
chunk? */
+ if (memcmp(buf, "RMID", 4) == 0) break;
+
+ pack_fseek(fp, pack_igetl(fp)); /* skip
to next chunk */
+ }
+
+ if (pack_feof(fp)) goto err;
+
+ pack_mgetl(fp);
+ pack_mgetl(fp);
+
+ pack_fread(buf, 4, fp); /* read
midi header */
+ }
+
if (memcmp(buf, "MThd", 4))
goto err;
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305665&aid=1223015&group_id=5665