
    ̺iT                     N    S SK Jr   " S S\5      rS	S jrS	S jrS	S jrS	S jrg)
   )MetaMessagec                   f    \ rS rSr\S 5       r\R                  S 5       rS rS rS r	S r
S rS	rg
)	MidiTrack   c                 R    U  H!  nUR                   S:X  d  M  UR                  s  $    g)aJ  Name of the track.

This will return the name from the first track_name meta
message in the track, or '' if there is no such message.

Setting this property will update the name field of the first
track_name message in the track. If no such message is found,
one will be added to the beginning of the track with a delta
time of 0.
track_name )typename)selfmessages     T/var/www/piano.thomer.com/venv/lib/python3.13/site-packages/mido/midifiles/tracks.pyr   MidiTrack.name	   s)     G|||+||#      c           	      |    U  H  nUR                   S:X  d  M  Xl          g    U R                  S[        SUSS95        g )Nr       )r   time)r
   r   insertr   )r   r   r   s      r   r   r      s;     G|||+#  KK;|$QGHr   c                 $    U R                  U 5      $ N)	__class__)r   s    r   copyMidiTrack.copy%   s    ~~d##r   c                 |    [         R                  X5      n[        U[        5      (       a  U$ U R	                  U5      $ r   )list__getitem__
isinstanceintr   )r   index_or_slicelsts      r   r   MidiTrack.__getitem__(   s5    t4nc**J >>#&&r   c                 J    U R                  [        R                  X5      5      $ r   )r   r   __add__r   others     r   r#   MidiTrack.__add__3       ~~dll4788r   c                 J    U R                  [        R                  X5      5      $ r   )r   r   __mul__r$   s     r   r)   MidiTrack.__mul__6   r'   r   c                     [        U 5      S:X  a  SnO@[        U 5      S:X  a
  SU S    S3nO'SR                  SR                  S U  5       5      5      nU R                  R                   S	U S
3$ )Nr   r	   r   []z[
  {}]z,
  c              3   8   #    U  H  n[        U5      v   M     g 7fr   )repr).0ms     r   	<genexpr>%MidiTrack.__repr__.<locals>.<genexpr>?   s     5Lt!d1ggts   ())lenformatjoinr   __name__)r   messagess     r   __repr__MidiTrack.__repr__9   sk    t9>HY!^47)1~H!((5Lt5L)LMH..))*!H:Q77r    N)r9   
__module____qualname____firstlineno__propertyr   setterr   r   r#   r)   r;   __static_attributes__r=   r   r   r   r      sG       
[[I I$	'998r   r   c              #   `   #    SnU  H"  nX#R                   -  nUR                  XS9v   M$     g7f)z"Convert messages to absolute time.r   skip_checksr   Nr   r   )r:   rF   nowmsgs       r   _to_abstimerJ   C   s0     
Cxxhh;h99 s   ,.c              #   z   #    SnU  H/  nUR                   U-
  nUR                  XS9v   UR                   nM1     g7f)z"Convert messages to relative time.r   rE   NrG   )r:   rF   rH   rI   deltas        r   _to_reltimerM   K   s;     
C3hh;h;;hh s   9;c              #      #    SnU  HQ  nUR                   S:X  a  X#R                  -  nM#  U(       a#  X#R                  -   nUR                  XS9v   SnMM  Uv   MS     [        SUS9v   g7f)zmRemove all end_of_track messages and add one at the end.

This is used by merge_tracks() and MidiFile.save().r   end_of_trackrE   r   N)r
   r   r   r   )r:   rF   accumrI   rL   s        r   fix_end_of_trackrR   T   sg      E88~%XXE(hh;hCC	  n5
11s   A'A)c           	          / nU  H  nUR                  [        X1S95        M     UR                  S S9  [        [	        [        X!S9US95      $ )aE  Returns a MidiTrack object with all messages from all tracks.

The messages are returned in playback order with delta times
as if they were all in one track.

Pass skip_checks=True to skip validation of messages before merging.
This should ONLY be used when the messages in tracks have already
been validated by mido.checks.
)rF   c                     U R                   $ r   rP   )rI   s    r   <lambda>merge_tracks.<locals>.<lambda>x   s    #((r   )key)extendrJ   sortr   rR   rM   )tracksrF   r:   tracks       r   merge_tracksr\   j   sU     HECD  MM*M+:#	
 r   N)F)metar   r   r   rJ   rM   rR   r\   r=   r   r   <module>r^      s+   
 88 88v:2,r   