
aKc           @   sg   d  f  d     YZ  e d j oC e    Z e i d d  e i d d d  e i d d d  n d S(   t   MidiOutStreamc           B   s  e  Z d  Z d   Z d d d  Z d   Z d   Z d   Z d   Z d	   Z	 d
   Z
 d   Z d   Z d   Z d d d d  Z d d d d  Z d d d d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d d d d  Z d   Z d   Z d d  Z d    Z d!   Z d"   Z  d#   Z! d$   Z" d%   Z# d&   Z$ d'   Z% d(   Z& d)   Z' d*   Z( d+   Z) d,   Z* d-   Z+ d.   Z, d/   Z- d0   Z. d1   Z/ d2   Z0 d3   Z1 d4   Z2 d5   Z3 RS(6   s)  

    MidiOutstream is Basically an eventhandler. It is the most central
    class in the Midi library. You use it both for writing events to
    an output stream, and as an event handler for an input stream.

    This makes it extremely easy to take input from one stream and
    send it to another. Ie. if you want to read a Midi file, do some
    processing, and send it to a midiport.

    All time values are in absolute values from the opening of a
    stream. To calculate time values, please use the MidiTime and
    MidiDeltaTime classes.

    c         C   s(   d |  _  d |  _ d |  _ d  |  _ d  S(   Ni    (   t   _absolute_timet   _relative_timet   _current_trackt   Nonet   _running_status(   t   self(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   __init__   s    			i    i   c         C   s@   | o | |  _  |  i | 7_ n | |  i |  _  | |  _ d S(   sk   
        Updates the time, if relative is true, new_time is relative, 
        else it's absolute.
        N(   R   R   (   R   t   new_timet   relative(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   update_time#   s
    	c         C   s   d |  _  d |  _ d S(   s!   
        reset time to 0
        i    N(   R   R   (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt
   reset_time/   s    	c         C   s   |  i  S(   s   Returns the relative time(   R   (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   rel_time6   s    c         C   s   |  i  S(   s   Returns the absolute time(   R   (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   abs_time:   s    c         C   s   d |  _ d S(   s   Invalidates the running statusN(   R   R   (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   reset_run_stat@   s    c         C   s   | |  _  d S(   s   Set the new running statusN(   R   (   R   t
   new_status(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   set_run_statD   s    c         C   s   |  i  S(   s   Set the new running status(   R   (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   get_run_statH   s    c         C   s   | |  _  d S(   s   Sets the current track numberN(   R   (   R   t	   new_track(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   set_current_trackN   s    c         C   s   |  i  S(   s    Returns the current track number(   R   (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   get_current_trackR   s    c         C   s   d S(   s.   The default event handler for channel messagesN(    (   R   t   message_typet   channelt   data(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   channel_message[   s    i@   c         C   s   d S(   s=   
        channel: 0-15
        note, velocity: 0-127
        N(    (   R   R   t   notet   velocity(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   note_on`   s    c         C   s   d S(   s=   
        channel: 0-15
        note, velocity: 0-127
        N(    (   R   R   R   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   note_offi   s    c         C   s   d S(   s=   
        channel: 0-15
        note, velocity: 0-127
        N(    (   R   R   R   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt
   aftertouchr   s    c         C   s   d S(   s@   
        channel: 0-15
        controller, value: 0-127
        N(    (   R   R   t
   controllert   value(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   continuous_controller{   s    c         C   s   d S(   s4   
        channel: 0-15
        patch: 0-127
        N(    (   R   R   t   patch(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   patch_change   s    c         C   s   d S(   s7   
        channel: 0-15
        pressure: 0-127
        N(    (   R   R   t   pressure(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   channel_pressure   s    c         C   s   d S(   s7   
        channel: 0-15
        value: 0-16383

        N(    (   R   R   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt
   pitch_bend   s    c         C   s   d S(   s4   
        data: list of values in range(128)
        N(    (   R   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   system_exclusive   s    c         C   s   d S(   s    
        value: 0-16383
        N(    (   R   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   song_position_pointer   s    c         C   s   d S(   s#   
        songNumber: 0-127
        N(    (   R   t
   songNumber(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   song_select   s    c         C   s   d S(   s"   
        No values passed
        N(    (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   tuning_request   s    c         C   s   d S(   s4   
        msg_type: 0-7
        values: 0-15
        N(    (   R   t   msg_typet   values(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   midi_time_code   s    i`   c         C   s   d S(   sx   
        format: type of midi file in [1,2]
        nTracks: number of tracks
        division: timing division
        N(    (   R   t   formatt   nTrackst   division(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   header   s    c         C   s   d S(   s>   
        End of file. No more events to be processed.
        N(    (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   eof   s    c         C   s   d S(   s3   
        Handles any undefined meta events
        N(    (   R   t	   meta_typeR   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt
   meta_event   s    c         C   s   d S(   s*   
        n_track: number of track
        N(    (   R   t   n_track(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   start_of_track   s    c         C   s   d S(   s*   
        n_track: number of track
        N(    (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   end_of_track   s    c         C   s   d S(   s    
        value: 0-16383
        N(    (   R   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   sequence_number  s    c         C   s   d S(   s1   
        Text event
        text: string
        N(    (   R   t   text(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyR9   	  s    c         C   s   d S(   s7   
        Copyright notice
        text: string
        N(    (   R   R9   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt	   copyright  s    c         C   s   d S(   s:   
        Sequence/track name
        text: string
        N(    (   R   R9   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   sequence_name  s    c         C   s   d S(   s   
        text: string
        N(    (   R   R9   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   instrument_name$  s    c         C   s   d S(   s   
        text: string
        N(    (   R   R9   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   lyric,  s    c         C   s   d S(   s   
        text: string
        N(    (   R   R9   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   marker4  s    c         C   s   d S(   s   
        text: string
        N(    (   R   R9   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   cuepoint<  s    c         C   s   d S(   sT   
        channel: midi channel for subsequent data (deprecated in the spec)
        N(    (   R   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   midi_ch_prefixD  s    c         C   s   d S(   s;   
        value: Midi port (deprecated in the spec)
        N(    (   R   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt	   midi_portL  s    c         C   s   d S(   s   
        value: 0-2097151
        tempo in us/quarternote
        (to calculate value from bpm: int(60,000,000.00 / BPM))
        N(    (   R   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   tempoT  s    c         C   s   d S(   sr  
        hour,
        minute,
        second: 3 bytes specifying the hour (0-23), minutes (0-59) and 
                seconds (0-59), respectively. The hour should be 
                encoded with the SMPTE format, just as it is in MIDI 
                Time Code.
        frame: A byte specifying the number of frames per second (one 
               of : 24, 25, 29, 30).
        framePart: A byte specifying the number of fractional frames, 
                   in 100ths of a frame (even in SMPTE-based tracks 
                   using a different frame subdivision, defined in the 
                   MThd chunk).
        N(    (   R   t   hourt   minutet   secondt   framet	   framePart(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   smtp_offset^  s    c         C   s   d S(   s  
        nn: Numerator of the signature as notated on sheet music
        dd: Denominator of the signature as notated on sheet music
            The denominator is a negative power of 2: 2 = quarter 
            note, 3 = eighth, etc.
        cc: The number of MIDI clocks in a metronome click
        bb: The number of notated 32nd notes in a MIDI quarter note 
            (24 MIDI clocks)        
        N(    (   R   t   nnt   ddt   cct   bb(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   time_signaturer  s    c         C   s   d S(   s  
        sf: is a byte specifying the number of flats (-ve) or sharps 
            (+ve) that identifies the key signature (-7 = 7 flats, -1 
            = 1 flat, 0 = key of C, 1 = 1 sharp, etc).
        mi: is a byte specifying a major (0) or minor (1) key.
        N(    (   R   t   sft   mi(    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   key_signature  s    c         C   s   d S(   s/   
        data: The data as byte values
        N(    (   R   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   sequencer_specific  s    c         C   s   d S(   s"   
        No values passed
        N(    (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   timing_clock  s    c         C   s   d S(   s"   
        No values passed
        N(    (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt
   song_start  s    c         C   s   d S(   s"   
        No values passed
        N(    (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt	   song_stop  s    c         C   s   d S(   s"   
        No values passed
        N(    (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   song_continue  s    c         C   s   d S(   s"   
        No values passed
        N(    (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   active_sensing  s    c         C   s   d S(   s"   
        No values passed
        N(    (   R   (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   system_reset  s    (4   t   __name__t
   __module__t   __doc__R   R
   R   R   R   R   R   R   R   R   R   R   R   R   R    R"   R$   R%   R&   R'   R)   R*   R-   R1   R2   R4   R6   R7   R8   R9   R:   R;   R<   R=   R>   R?   R@   RA   RB   RH   RM   RP   RQ   RR   RS   RT   RU   RV   RW   (    (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyR       sd   																										
																	
														t   __main__i    i?   i   N(   R    RX   t   midiOutR
   R   R   (    (    (    s[   C:\Documents and Settings\Samuel Benveniste\workspace\MINWiiV7\src\mxmMidi\MidiOutStream.pyt   <module>   s    	