PageRenderTime 303ms CodeModel.GetById 141ms app.highlight 2ms RepoModel.GetById 159ms app.codeStats 0ms

/src/echonest/support/midi/MidiInStream.py

http://echo-nest-remix.googlecode.com/
Python | 52 lines | 22 code | 12 blank | 18 comment | 1 complexity | 4aface9043a5f15241bdbe06ad7f1926 MD5 | raw file
 1# -*- coding: ISO-8859-1 -*-

 2
 3from MidiOutStream import MidiOutStream
 4
 5class MidiInStream:
 6
 7    """

 8    Takes midi events from the midi input and calls the apropriate

 9    method in the eventhandler object

10    """
11
12    def __init__(self, midiOutStream, device):
13
14        """

15

16        Sets a default output stream, and sets the device from where

17        the input comes

18

19        """
20
21        if midiOutStream is None:
22            self.midiOutStream = MidiOutStream()
23        else:
24            self.midiOutStream = midiOutStream
25
26
27    def close(self):
28
29        """

30        Stop the MidiInstream

31        """
32
33
34    def read(self, time=0):
35
36        """

37

38        Start the MidiInstream.

39

40        "time" sets timer to specific start value.

41

42        """
43
44
45    def resetTimer(self, time=0):
46        """

47

48        Resets the timer, probably a good idea if there is some kind

49        of looping going on

50

51        """
52