/// <summary> /// Raises SoundEvent /// </summary> /// <param name="e">SoundEvent Args</param> protected void OnSoundEvent(SoundEventArgs e) { if (SoundEvent != null) { SoundEvent(this, e); } }
private void ProcessSoundEvent(object sender, SoundEventArgs e) { if (e.Action == SoundAction.Stop) { this.Stop(); } else if (e.Action == SoundAction.Fadeout) { this.Fadeout(e.FadeoutTime); } else { throw new SdlException(); } }
/// <summary> /// Fades out the sound sample. /// </summary> public void Fadeout(int fadeoutTime) { SoundEventArgs args = new SoundEventArgs(SoundAction.Fadeout, fadeoutTime); OnSoundEvent(args); }
/// <summary> /// Stops the sound sample. /// </summary> public void Stop() { SoundEventArgs args = new SoundEventArgs(SoundAction.Stop); OnSoundEvent(args); }