source file of the GNU LilyPond music typesetter
- (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 2001--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
midi.parse_track (s)
midi.parse (s)
+
+returns a MIDI file as the tuple
+
+ (format, division, TRACKLIST)
+
+each track is an EVENTLIST, where EVENT is
+
+ (time, (type, ARG1, [ARG2]))
+
*/
#include <Python.h>
+/* PyMIDINIT_FUNC isn't defined in Python < 2.3 */
+#ifndef PyMODINIT_FUNC
+# if defined(__cplusplus)
+# define PyMODINIT_FUNC extern "C" void
+# else /* __cplusplus */
+# define PyMODINIT_FUNC void
+# endif /* __cplusplus */
+#endif
+
#if 0
int x = 0;
int *track = &x;
track_size = track_end - *track;
debug_print ("%s", "\n");
- if (strcmp (*track, "MTrk"))
+ if (memcmp (*track, "MTrk", 4))
return midi_error (__FUNCTION__, ": MTrk expected");
*track += 4;
if (!PyArg_ParseTuple (args, "s#", &midi, &midi_size))
return 0;
- if (strcmp (midi, "MThd"))
+ if (memcmp (midi, "MThd", 4))
return midi_error (__FUNCTION__, ": MThd expected");
midi += 4;
{0, 0} /* Sentinel */
};
-void
-initmidi ()
+PyMODINIT_FUNC
+initmidi (void)
{
PyObject *m, *d;
m = Py_InitModule ("midi", MidiMethods);