]> CRI, Mines Paris - PSL - minwii.git/blobdiff - src/mxmMidi/experimental/MidiOutStreamBase.py
ménage (par le vide)
[minwii.git] / src / mxmMidi / experimental / MidiOutStreamBase.py
diff --git a/src/mxmMidi/experimental/MidiOutStreamBase.py b/src/mxmMidi/experimental/MidiOutStreamBase.py
deleted file mode 100644 (file)
index 1abada0..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-class MidiOutStreamBase:\r
-\r
-\r
-    """\r
-\r
-    MidiOutStreamBase is Basically an eventhandler. It is the most central\r
-    class in the Midi library. You use it both for writing events to\r
-    an output stream, and as an event handler for an input stream.\r
-\r
-    This makes it extremely easy to take input from one stream and\r
-    send it to another. Ie. if you want to read a Midi file, do some\r
-    processing, and send it to a midiport.\r
-\r
-    All time values are in absolute values from the opening of a\r
-    stream. To calculate time values, please use the MidiTime and\r
-    MidiDeltaTime classes.\r
-\r
-    """\r
-\r
-    def __init__(self):\r
-        \r
-        # the time is rather global, so it needs to be stored \r
-        # here. Otherwise there would be no really simple way to \r
-        # calculate it. The alternative would be to have each event \r
-        # handler do it. That sucks even worse!\r
-        self._absolute_time = 0\r
-        self._relative_time = 0\r
-        self._current_track = 0\r
-\r
-    # time handling event handlers. They should overwritten with care\r
-\r
-    def update_time(self, new_time=0, relative=1):\r
-        """\r
-        Updates the time, if relative is true, new_time is relative, \r
-        else it's absolute.\r
-        """\r
-        if relative:\r
-            self._relative_time = new_time\r
-            self._absolute_time += new_time\r
-        else:\r
-            self._absolute_time = new_time\r
-            self._relative_time = new_time - self._absolute_time\r
-\r
-    def rel_time(self):\r
-        "Returns the relative time"\r
-        return self._relative_time\r
-\r
-    def abs_time(self):\r
-        "Returns the absolute time"\r
-        return self._absolute_time\r
-\r
-    # track handling event handlers\r
-    \r
-    def set_current_track(self, new_track):\r
-        "Sets the current track number"\r
-        self._current_track = new_track\r
-    \r
-    def get_current_track(self):\r
-        "Returns the current track number"\r
-        return self._current_track\r
-    \r
-    \r
-    #####################\r
-    ## Midi events\r
-\r
-\r
-    def channel_message(self, message_type, channel, data):\r
-        """The default event handler for channel messages"""\r
-        pass\r
-\r
-\r
-    #####################\r
-    ## Common events\r
-\r
-    def system_exclusive(self, data):\r
-\r
-        """The default event handler for system_exclusive messages"""\r
-        pass\r
-\r
-\r
-    def system_common(self, common_type, common_data):\r
-\r
-        """The default event handler for system common messages"""\r
-        pass\r
-\r
-\r
-    #########################\r
-    # header does not really belong here. But anyhoo!!!\r
-    \r
-    def header(self, format, nTracks, division):\r
-\r
-        """\r
-        format: type of midi file in [1,2]\r
-        nTracks: number of tracks\r
-        division: timing division\r
-        """\r
-        pass\r
-\r
-\r
-    def start_of_track(self, n_track=0):\r
-\r
-        """\r
-        n_track: number of track\r
-        """\r
-        pass\r
-\r
-\r
-    def eof(self):\r
-\r
-        """\r
-        End of file. No more events to be processed.\r
-        """\r
-        pass\r
-\r
-\r
-    #####################\r
-    ## meta events\r
-\r
-\r
-    def meta_event(self, meta_type, data, time):\r
-        \r
-        """The default event handler for meta_events"""\r
-        pass\r
-\r
-\r
-\r
-\r
-if __name__ == '__main__':\r
-\r
-    midiOut = MidiOutStreamBase()\r
-    midiOut.update_time(0,0)\r
-    midiOut.note_on(0, 63, 127)\r
-    midiOut.note_off(0, 63, 127)\r
-\r
-    
\ No newline at end of file