Пример #1
0
 private void OnDisposed(bool manually)
 {
     this.prio = SoundBudgetPriority.Lowest;
     if (this.instance != null)
     {
         this.instance.Stop();
         this.instance = null;
     }
 }
Пример #2
0
        /// <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);
        }
Пример #3
0
        }                                               //	GS

        internal SoundBudgetPad(SoundInstance snd, SoundBudgetPriority prio)
        {
            this.instance = snd;
            this.prio     = prio;
        }
Пример #4
0
		/// <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;
		}
Пример #5
0
		private void OnDisposed(bool manually)
		{
			this.prio = SoundBudgetPriority.Lowest;
			if (this.instance != null)
			{
				this.instance.Stop();
				this.instance = null;
			}
		}
Пример #6
0
		}					//	GS
		
		internal SoundBudgetPad(SoundInstance snd, SoundBudgetPriority prio)
		{
			this.instance = snd;
			this.prio = prio;
		}
		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;
		}