Example #1
0
        // TODO: Cleanup: Get rid of or move this method?
        /// <summary>Return the sound for a given music cue. Not to be used in the simulation (play it immediately).</summary>
        public string LocalGetPathForMusicCue(Cue cue)
        {
            string musicPath = null;

            if (ReferenceEquals(cue, missingCue))
            {
#if DEVELOPER
                musicPath = MissingAudio.GetMissingMusicPath();                 // <- TODO: Put me back?
#endif
            }
            else if (cue != null && cue.SoundCount > 0)
            {
                // Assumption: Music Cue is just a single sound with no variations!
                Debug.Assert(cue.SoundCount == 1);
                musicPath = cue.sounds[0].path;
            }

            return(musicPath);
        }
Example #2
0
        public Cue GetCue(string name, object debugContext)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return(null);
            }

            Cue result;

            if (cues.TryGetValue(name, out result))
            {
                return(result);
            }

#if DEVELOPER
            MissingAudio.ReportMissingCue(name, debugContext); // <- NOTE: This has its own internal no-repeat handling, so it's fine with rollbacks
#endif
            return(missingCue);
        }
Example #3
0
        /// <summary>Return the sound for a given music cue. Not to be used in the simulation (play it immediately).</summary>
        public SafeSoundEffect LocalGetSoundForMusicCue(Cue cue)
        {
            SafeSoundEffect music = null;

            if (ReferenceEquals(cue, missingCue))
            {
#if DEVELOPER
                music = MissingAudio.GetMissingMusicSound();
#endif
            }
            else if (cue != null && cue.SoundCount > 0)
            {
                // Assumption: Music Cue is just a single sound with no variations!
                Debug.Assert(cue.SoundCount == 1);
                music = GetSound(cue, 0);
            }

            return(music);
        }