private void OnDisposed(bool manually) { this.prio = SoundBudgetPriority.Lowest; if (this.instance != null) { this.instance.Stop(); this.instance = null; } }
/// <summary> /// Schedules a new budget pad. /// </summary> /// <param name="snd">The Sound that is to play.</param> /// <param name="priority">The priority of the pad.</param> /// <param name="fadeInTimeSec">The pads fadein time in seconds.</param> /// <returns>A new SoundBudgetPad.</returns> public SoundBudgetPad Push(ContentRef <Sound> snd, SoundBudgetPriority priority, float fadeInTimeSec = DefaultFadeInTime) { SoundInstance inst = DualityApp.Sound.PlaySound(snd); SoundBudgetPad bP = new SoundBudgetPad(inst, priority); bP.Instance.Paused = true; if (fadeInTimeSec > 0.05f) { bP.Instance.BeginFadeIn(fadeInTimeSec); } this.budgetPads.Add(bP); return(bP); }
} // GS internal SoundBudgetPad(SoundInstance snd, SoundBudgetPriority prio) { this.instance = snd; this.prio = prio; }
/// <summary> /// Schedules a new budget pad. /// </summary> /// <param name="snd">The Sound that is to play.</param> /// <param name="priority">The priority of the pad.</param> /// <param name="fadeInTimeSec">The pads fadein time in seconds.</param> /// <returns>A new SoundBudgetPad.</returns> public SoundBudgetPad Push(ContentRef<Sound> snd, SoundBudgetPriority priority, float fadeInTimeSec = DefaultFadeInTime) { SoundInstance inst = DualityApp.Sound.PlaySound(snd); SoundBudgetPad bP = new SoundBudgetPad(inst, priority); bP.Instance.Paused = true; if (fadeInTimeSec > 0.05f) bP.Instance.BeginFadeIn(fadeInTimeSec); this.budgetPads.Add(bP); return bP; }
protected virtual void OnDisposed(bool disposing) { if (!this.disposed) { this.prio = SoundBudgetPriority.Lowest; if (this.sound != null) { this.sound.Stop(); this.sound = null; } this.disposed = true; } }
} // GS internal SoundBudgetPad(SoundInstance snd, SoundBudgetPriority prio, bool music = true) { this.sound = snd; this.prio = prio; }