Esempio n. 1
0
        public TrackSequence( Sequencer fakeSequencer, TrackInfo trackInfo )
        {
            sequencer = fakeSequencer;
            info = trackInfo;

            nextEventIndex = 0;
            trackEnded = false;
            remainingDeltas = info.events[ 0 ].deltas;
            sumsOfDeltas = remainingDeltas;
            noteOns = new List<Sequencer.NoteOn>();
        }
Esempio n. 2
0
        public TrackInfo Parse( FileStream stream, int trackIndex )
        {
            TrackInfo result = new TrackInfo();
            result.index = trackIndex;

            ParseMtrk( stream );
            OmitIgnoredTrackSize( stream );

            MidiEventParser eventParser = new MidiEventParser();
            List<MidiEvent> events = new List<MidiEvent>();
            MidiEvent midiEvent = null;
            while ( !( midiEvent is EndOfTrackMetaEvent ) && stream.Position < stream.Length-1 ) {
                midiEvent = eventParser.Parse( stream );
                events.Add( midiEvent );
            }
            result.events = events.ToArray();

            return result;
        }
Esempio n. 3
0
 void InitializeTrackSequences( TrackInfo[] tracks )
 {
     trackSequences = new TrackSequence[ tracks.Length ];
     for ( int i = 0; i < trackSequences.Length; i++ ) {
         trackSequences[ i ] = new TrackSequence( this, tracks[ i ] );
     }
 }
Esempio n. 4
0
 static void LogTrack( TrackInfo info, StringBuilder output )
 {
     output.AppendLine( info.ToString() );
 }