GetEnumerator() public method

public GetEnumerator ( ) : List.Enumerator
return List.Enumerator
Ejemplo n.º 1
0
        // Constructor
        //   "ppqn" stands for Pulse Per Quater Note,
        //   which is usually provided with a MIDI header.
        public MidiTrackSequencer(MidiTrack track, int ppqn, float bpm)
        {
            pulsePerSecond = bpm / 60.0f * ppqn;
            enumerator     = track.GetEnumerator();

            //  UnityEngine.Debug.Log("Pulse per second: " + pulsePerSecond);
        }
        // Start the sequence.
        // Returns a list of events at the beginning of the track.
        public List <MidiEvent> Start(float startTime = 0.0f)
        {
            _enumerator.Dispose();
            _enumerator   = _track.GetEnumerator();
            _pulseCounter = 0;

            if (_enumerator.MoveNext())
            {
                _pulseToNext = _enumerator.Current.Key;
                _isPlaying   = true;
                return(Advance(startTime));
            }
            else
            {
                _isPlaying = false;
                return(null);
            }
        }
Ejemplo n.º 3
0
 public MidiTrackSequencer(MidiTrack track, int ppqn, float bpm)
 {
     pulsePerSecond = bpm / 60.0f * ppqn;
     enumerator = track.GetEnumerator ();
 }
Ejemplo n.º 4
0
 // Constructor
 //   "ppqn" stands for Pulse Per Quater Note,
 //   which is usually provided with a MIDI header.
 public MidiTrackSequencer(MidiTrack track, int ppqn, float bpm)
 {
     pulsePerSecond = bpm / 60.0f * ppqn;
     enumerator     = track.GetEnumerator();
 }