]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/midi.c
Add Output_def argument to Font_metric::text_stencil().
[lilypond.git] / python / midi.c
index ef6c7af810455d315e2e059c552e37f0c05a7b12..be06bb66cea0f892ba5ae79d9eb2ae5a7fd06ebb 100644 (file)
@@ -1,11 +1,22 @@
 /*
-  midi.c -- implement Python midi parser module
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
-
-  (c) 2001--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2001--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
             Jan Nieuwenhuizen <janneke@gnu.org>
 
+
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 /*
@@ -19,7 +30,7 @@ midi.parse (s)
 
 returns a MIDI file as the tuple
 
- (format, division, TRACKLIST) 
+ ((format, division), TRACKLIST) 
 
 each track is an EVENTLIST, where EVENT is
 
@@ -273,7 +284,6 @@ static PyObject *
 midi_parse_track (unsigned char **track, unsigned char *track_end)
 {
   unsigned int time = 0;
-  unsigned char running_status;
   unsigned long track_len, track_size;
   PyObject *pytrack = 0;
 
@@ -305,6 +315,8 @@ midi_parse_track (unsigned char **track, unsigned char *track_end)
 
   {  
     PyObject *pytime = PyInt_FromLong (0L);
+    unsigned char running_status = 0;
+       
     while (*track < track_end)
       {
        long dt = get_variable_length_number(track, track_end);
@@ -332,8 +344,6 @@ pymidi_parse_track (PyObject *self, PyObject *args)
   unsigned char *track, *track_end;
   unsigned long track_size;
 
-  PyObject * sobj = PyTuple_GetItem (args, 0);
-
   debug_print ("%s", "\n");
   if (!PyArg_ParseTuple (args, "s#", &track, &track_size))
     return 0;
@@ -373,7 +383,7 @@ midi_parse (unsigned char **midi,unsigned  char *midi_end)
 
 
   if (division < 0)
-    /* return midi_error ("can't handle non-metrical time"); */
+    /* return midi_error (cannot handle non-metrical time"); */
     ;
   *midi += header_len - 6;
 
@@ -394,8 +404,6 @@ pymidi_parse (PyObject *self, PyObject *args)
   unsigned char *midi, *midi_end;
   unsigned long midi_size;
   
-  PyObject *sobj = PyTuple_GetItem (args, 0);
-
   debug_print ("%s", "\n");
   if (!PyArg_ParseTuple (args, "s#", &midi, &midi_size))
     return 0;
@@ -430,5 +438,10 @@ initmidi (void)
   add_constants (d);
   Midi_warning = PyString_FromString ("midi.warning");
   PyDict_SetItemString (d, "warning", Midi_warning);
+
+  /*
+    FIXME.
+   */
+  (void) midi_warning;
 }