/**<summary>Reset this sound so that it will play from the start.</summary>*/ public void Reset() { BeatCollection.Enumerator = BeatCollection.GetEnumerator(); ByteInterval = 0; if (Metronome.GetInstance().IsSilentInterval) { SetSilentInterval(Metronome.GetInstance().AudibleInterval, Metronome.GetInstance().SilentInterval); } if (Metronome.GetInstance().IsRandomMute) { randomMuteCountdown = null; currentlyMuted = false; } if (Layer.Offset > 0) { SetOffset( BeatCell.ConvertFromBpm(Layer.Offset, this) ); } // TODO: hihat open settings HiHatOpenIsMuted = false; //HiHatMuteInitiated = false; HiHatCycleToMute = 0; cycle = 0; // will first muting occur for first sound? SetInitialMuting(); // set stream back to start. Position = 0; }
/**<summary>Reset state to default values.</summary>*/ public void Reset() { freqEnum.Reset(); //= Frequencies.Values.GetEnumerator(); BeatCollection.Enumerator = BeatCollection.GetEnumerator(); ByteInterval = 0; previousSample = 0; Gain = Volume; if (Metronome.GetInstance().IsSilentInterval) { SetSilentInterval(Metronome.GetInstance().AudibleInterval, Metronome.GetInstance().SilentInterval); } if (Metronome.GetInstance().IsRandomMute) { randomMuteCountdown = null; currentlyMuted = false; } if (Layer.Offset > 0) { SetOffset( BeatCell.ConvertFromBpm(Layer.Offset, this) ); } }