Exemple #1
0
        internal Cue(
            AudioEngine audioEngine,
            List <string> waveBankNames,
            string name,
            CueData data,
            bool managed
            )
        {
            INTERNAL_baseEngine = audioEngine;

            Name = name;

            INTERNAL_data = data;
            IsPrepared    = false;
            IsPreparing   = true;
            foreach (XACTSound curSound in data.Sounds)
            {
                if (!curSound.HasLoadedTracks)
                {
                    curSound.LoadTracks(
                        INTERNAL_baseEngine,
                        waveBankNames
                        );
                }
            }
            IsPrepared  = true;
            IsPreparing = false;

            INTERNAL_isManaged = managed;

            INTERNAL_category = INTERNAL_baseEngine.INTERNAL_initCue(
                this,
                data.Category
                );

            eventVolume = 1.0f;
            eventPitch  = 0.0f;

            INTERNAL_userControlledPlaying = false;
            INTERNAL_isPositional          = false;

            INTERNAL_eventList       = new List <XACTEvent>();
            INTERNAL_eventPlayed     = new List <bool>();
            INTERNAL_eventLoops      = new Dictionary <XACTEvent, int>();
            INTERNAL_waveEventSounds = new Dictionary <SoundEffectInstance, XACTEvent>();

            INTERNAL_timer = new Stopwatch();

            INTERNAL_instancePool    = new List <SoundEffectInstance>();
            INTERNAL_instanceVolumes = new List <float>();
            INTERNAL_instancePitches = new List <float>();

            INTERNAL_rpcTrackVolumes = new List <float>();
            INTERNAL_rpcTrackPitches = new List <float>();
        }
Exemple #2
0
        internal Cue(
			AudioEngine audioEngine,
			List<string> waveBankNames,
			string name,
			CueData data,
			bool managed
		)
        {
            INTERNAL_baseEngine = audioEngine;

            Name = name;

            INTERNAL_data = data;
            foreach (XACTSound curSound in data.Sounds)
            {
                if (!curSound.HasLoadedTracks)
                {
                    curSound.LoadTracks(
                        INTERNAL_baseEngine,
                        waveBankNames
                    );
                }
            }

            INTERNAL_isManaged = managed;

            INTERNAL_category = INTERNAL_baseEngine.INTERNAL_initCue(
                this,
                data.Category
            );

            eventVolume = 1.0f;
            eventPitch = 0.0f;

            INTERNAL_userControlledPlaying = false;
            INTERNAL_isPositional = false;

            INTERNAL_eventList = new List<XACTEvent>();
            INTERNAL_eventPlayed = new List<bool>();
            INTERNAL_eventLoops = new Dictionary<XACTEvent, int>();
            INTERNAL_waveEventSounds = new Dictionary<SoundEffectInstance, XACTEvent>();

            INTERNAL_timer =  new Stopwatch();

            INTERNAL_instancePool = new List<SoundEffectInstance>();
            INTERNAL_instanceVolumes = new List<float>();
            INTERNAL_instancePitches = new List<float>();

            INTERNAL_rpcTrackVolumes = new List<float>();
            INTERNAL_rpcTrackPitches = new List<float>();
        }
Exemple #3
0
        internal Cue(
            AudioEngine audioEngine,
            List <string> waveBankNames,
            string name,
            CueData data,
            bool managed
            )
        {
            INTERNAL_baseEngine = audioEngine;

            Name = name;

            INTERNAL_data = data;
            foreach (XACTSound curSound in data.Sounds)
            {
                if (!curSound.HasLoadedTracks)
                {
                    curSound.LoadTracks(
                        INTERNAL_baseEngine,
                        waveBankNames
                        );
                }
            }

            INTERNAL_isManaged = managed;

            INTERNAL_category = INTERNAL_baseEngine.INTERNAL_initCue(
                this,
                data.Category
                );

            INTERNAL_userControlledPlaying = false;
            INTERNAL_isPositional          = false;
            INTERNAL_queuedPlayback        = false;
            INTERNAL_queuedPaused          = false;

            INTERNAL_instancePool    = new List <SoundEffectInstance>();
            INTERNAL_instanceVolumes = new List <float>();
            INTERNAL_instancePitches = new List <float>();
        }
Exemple #4
0
        internal Cue(
			AudioEngine audioEngine,
			List<string> waveBankNames,
			string name,
			CueData data,
			bool managed
		)
        {
            INTERNAL_baseEngine = audioEngine;

            Name = name;

            INTERNAL_data = data;
            foreach (XACTSound curSound in data.Sounds)
            {
                if (!curSound.HasLoadedTracks)
                {
                    curSound.LoadTracks(
                        INTERNAL_baseEngine,
                        waveBankNames
                    );
                }
            }

            INTERNAL_isManaged = managed;

            INTERNAL_category = INTERNAL_baseEngine.INTERNAL_initCue(
                this,
                data.Category
            );

            INTERNAL_userControlledPlaying = false;
            INTERNAL_isPositional = false;
            INTERNAL_queuedPlayback = false;
            INTERNAL_queuedPaused = false;

            INTERNAL_instancePool = new List<SoundEffectInstance>();
            INTERNAL_instanceVolumes = new List<float>();
            INTERNAL_instancePitches = new List<float>();
        }
Exemple #5
0
        internal Cue(
            AudioEngine audioEngine,
            List <string> waveBankNames,
            string name,
            CueData data,
            bool managed
            )
        {
            INTERNAL_baseEngine    = audioEngine;
            INTERNAL_waveBankNames = waveBankNames;

            Name = name;

            INTERNAL_data = data;
            IsPrepared    = false;
            IsPreparing   = true;

            INTERNAL_maxRpcReleaseTime = 0;

            foreach (XACTSound curSound in data.Sounds)
            {
                /* Determine the release times per track, if any, to be used to extend
                 * the sound when playing the release.
                 */
                {
                    ushort maxReleaseMS = 0;

                    // Loop over tracks.
                    for (int i = 0; i < curSound.RPCCodes.Count; i += 1)
                    {
                        // Loop over curves.
                        foreach (uint curCode in curSound.RPCCodes[i])
                        {
                            RPC curRPC = INTERNAL_baseEngine.INTERNAL_getRPC(curCode);
                            if (!INTERNAL_baseEngine.INTERNAL_isGlobalVariable(curRPC.Variable))
                            {
                                // Only release times applied to volume are considered.
                                if (curRPC.Variable.Equals("ReleaseTime") && curRPC.Parameter == RPCParameter.Volume)
                                {
                                    maxReleaseMS = Math.Max((ushort)curRPC.LastPoint.X, maxReleaseMS);
                                }
                            }
                        }
                    }

                    // Keep track of the maximum release time to extend the sound.
                    INTERNAL_maxRpcReleaseTime = maxReleaseMS;
                }
            }

            IsPrepared  = true;
            IsPreparing = false;

            IsStopped = false;

            INTERNAL_isManaged = managed;

            INTERNAL_category = INTERNAL_baseEngine.INTERNAL_initCue(
                this,
                data.Category
                );

            eventVolume = 0.0;
            eventPitch  = 0.0f;

            INTERNAL_userControlledPlaying = false;
            INTERNAL_isPositional          = false;

            INTERNAL_playWaveEventBySound =
                new Dictionary <SoundEffectInstance, PlayWaveEventInstance>();

            INTERNAL_timer = new Stopwatch();

            INTERNAL_instancePool    = new List <SoundEffectInstance>();
            INTERNAL_instanceVolumes = new List <double>();
            INTERNAL_instancePitches = new List <short>();

            INTERNAL_rpcTrackVolumes = new List <float>();
            INTERNAL_rpcTrackPitches = new List <float>();
        }