CSharpSynth.Sequencer.MidiSequencer.SetTime C# (CSharp) Method

SetTime() private method

private SetTime ( System.TimeSpan time ) : void
time System.TimeSpan
return void
        private void SetTime(TimeSpan time)
        {
            int _stime = SynthHelper.getSampleFromTime(synth.SampleRate, (float)time.TotalSeconds);
            if (_stime > sampleTime)
            {
                SilentProcess(_stime - sampleTime);
            }
            else if (_stime < sampleTime)
            {//we have to restart the midi to make sure we get the right temp, instrument, etc
                synth.Stop();
                Array.Clear(currentPrograms, 0, currentPrograms.Length);
                ResetControllers();
                _MidiFile.BeatsPerMinute = 120;
                SilentProcess(_stime);
            }
        }