Exemplo n.º 1
0
Arquivo: Cue.cs Projeto: raizam/FNA
 public void Dispose()
 {
     if (!IsDisposed)
     {
         if (Disposing != null)
         {
             Disposing.Invoke(this, null);
         }
         if (INTERNAL_instancePool != null)
         {
             foreach (SoundEffectInstance sfi in INTERNAL_instancePool)
             {
                 sfi.Dispose();
             }
             INTERNAL_instancePool.Clear();
             INTERNAL_instanceVolumes.Clear();
             INTERNAL_instancePitches.Clear();
             INTERNAL_rpcTrackVolumes.Clear();
             INTERNAL_rpcTrackPitches.Clear();
             INTERNAL_timer.Stop();
         }
         INTERNAL_category.INTERNAL_removeActiveCue(this);
         IsDisposed = true;
     }
 }
Exemplo n.º 2
0
        public void Stop(AudioStopOptions options)
        {
            if (INTERNAL_queuedPlayback)
            {
                INTERNAL_queuedPlayback = false;
                INTERNAL_category.INTERNAL_removeActiveCue(this);
                return;
            }
            foreach (SoundEffectInstance sfi in INTERNAL_instancePool)
            {
                sfi.Stop();
                sfi.Dispose();
            }
            INTERNAL_instancePool.Clear();
            INTERNAL_instanceVolumes.Clear();
            INTERNAL_instancePitches.Clear();
            INTERNAL_userControlledPlaying = false;
            INTERNAL_category.INTERNAL_removeActiveCue(this);

            // If this is a managed Cue, we're done here.
            if (INTERNAL_isManaged)
            {
                Dispose();
            }
        }
Exemplo n.º 3
0
        public void Dispose()
        {
            if (!IsDisposed)
            {
                if (Disposing != null)
                {
                    Disposing.Invoke(this, null);
                }
                if (INTERNAL_instancePool != null)
                {
                    foreach (SoundEffectInstance sfi in INTERNAL_instancePool)
                    {
                        sfi.Dispose();
                    }
                    INTERNAL_instancePool.Clear();
                    INTERNAL_instanceVolumes.Clear();
                    INTERNAL_instancePitches.Clear();
                    INTERNAL_rpcTrackVolumes.Clear();
                    INTERNAL_rpcTrackPitches.Clear();
                    INTERNAL_timer.Stop();
                }
                INTERNAL_category.INTERNAL_removeActiveCue(this);
                IsDisposed = true;

                // IXACTCue* no longer exists, these should all be false
                IsStopped  = false;
                IsCreated  = false;
                IsPrepared = false;
            }
        }
Exemplo n.º 4
0
 private void KillCue()
 {
     INTERNAL_timer.Stop();
     INTERNAL_timer.Reset();
     if (INTERNAL_activeSound != null)
     {
         if (INTERNAL_waveBankNames.Count > 0)                 // AKA !SoundBank.IsDisposed
         {
             INTERNAL_activeSound.Dispose(
                 INTERNAL_baseEngine,
                 INTERNAL_waveBankNames
                 );
         }
         INTERNAL_activeSound = null;
     }
     INTERNAL_category.INTERNAL_removeActiveCue(this);
 }