示例#1
0
        // 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;
                }
            }
        }
示例#2
0
        private void SetCurrentSoundSequence(int targetSoundSequenceIndex)
        {
            currentSoundSequenceIndex = targetSoundSequenceIndex;
            currentSoundSequence      = currentSection.SoundSequences[currentSoundSequenceIndex];

            currentSoundSequence.ResetPosition();
            currentSoundSequence.GetNextState(ref SoundSignal.Level, out nextStateChangeCountdown);
        }