~ubuntu-branches/ubuntu/precise/fofix-dfsg/precise

« back to all changes in this revision

Viewing changes to src/midi/MidiInStream.py

  • Committer: Bazaar Package Importer
  • Author(s): Christian Hammers
  • Date: 2010-02-21 12:09:32 UTC
  • Revision ID: james.westby@ubuntu.com-20100221120932-6bh992d2u8dtj9gr
Tags: upstream-3.121
ImportĀ upstreamĀ versionĀ 3.121

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: ISO-8859-1 -*-
 
2
 
 
3
from MidiOutStream import MidiOutStream
 
4
 
 
5
class 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