Exemplo n.º 1
0
        /// <summary>
        /// Frees channel, sound and DSP resources
        /// </summary>
        private void FreeChannelResources()
        {
            //stop any playing channels
            if (_channel != null)
            {
                _channel.stop();
                _channel = null;
            }

            //release sound
            if (_sound != null)
            {
                _sound.release();
                _sound = null;
            }

            //free waveform DSP
            if (_dsp != null)
            {
                _dsp.release();
                _dsp = null;
            }

            //destroy the equalizer
            DestroyEqualizer();
        }
Exemplo n.º 2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                FMOD.RESULT result;

                /*
                 *  Shut down
                 */
                if (dsp != null)
                {
                    result = dsp.release();
                    ERRCHECK(result);
                }
                if (system != null)
                {
                    result = system.close();
                    ERRCHECK(result);
                    result = system.release();
                    ERRCHECK(result);
                }

                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }
Exemplo n.º 3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                FMOD.RESULT result;

                if (sound != null)
                {
                    result = sound.release();
                    ERRCHECK(result);
                }

                if (dsplowpass != null)
                {
                    result = dsplowpass.release();
                    ERRCHECK(result);
                }

                if (dspchorus != null)
                {
                    result = dspchorus.release();
                    ERRCHECK(result);
                }

                if (system != null)
                {
                    result = system.close();
                    ERRCHECK(result);

                    result = system.release();
                    ERRCHECK(result);
                }

                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }
Exemplo n.º 4
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                FMOD.RESULT result;

                /*
                 *  Shut down
                 */
                /*
                 *  Shut down
                 */
                for (int count = 0; count < 5; count++)
                {
                    if (sound[count] != null)
                    {
                        result = sound[count].release();
                        ERRCHECK(result);
                    }
                }

                if (dspecho != null)
                {
                    result = dspecho.release();
                    ERRCHECK(result);
                }
                if (dspflange != null)
                {
                    result = dspflange.release();
                    ERRCHECK(result);
                }
                if (dsplowpass != null)
                {
                    result = dsplowpass.release();
                    ERRCHECK(result);
                }

                if (groupA != null)
                {
                    result = groupA.release();
                    ERRCHECK(result);
                }
                if (groupB != null)
                {
                    result = groupB.release();
                    ERRCHECK(result);
                }

                if (system != null)
                {
                    result = system.close();
                    ERRCHECK(result);
                    result = system.release();
                    ERRCHECK(result);
                }

                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }