// int lastChangeTime; public void Tick() { if (recorderState == STATE_PLAYING) { PlayingTime++; nextStateChangeCountdown--; if (nextStateChangeCountdown == 0) { if (!currentSoundSequence.GetNextState(ref SoundSignal.Level, out nextStateChangeCountdown)) { currentSoundSequenceIndex++; if (currentSoundSequenceIndex < currentSection.SoundSequences.Count) { SetCurrentSoundSequence(currentSoundSequenceIndex); } else { currentSectionIndex++; if (currentSectionIndex < Tape.Sections.Count) { SetCurrentSection(currentSectionIndex, false); } else { Stop(); } } } //Console.WriteLine((PlayingTime - lastChangeTime) + " : " + SoundSignal.Level); //lastChangeTime = PlayingTime; } } }
private void SetCurrentSoundSequence(int targetSoundSequenceIndex) { currentSoundSequenceIndex = targetSoundSequenceIndex; currentSoundSequence = currentSection.SoundSequences[currentSoundSequenceIndex]; currentSoundSequence.ResetPosition(); currentSoundSequence.GetNextState(ref SoundSignal.Level, out nextStateChangeCountdown); }