Inheritance: ISoundEffect
示例#1
0
        public string EffectFromInfo(SoundInfo info)
        {
            if (loadedSounds.ContainsKey(info.Name))
            {
                return(info.Name);
            }

            ISoundEffect sound;

            if (info.Type == AudioType.Wav)
            {
                sound = new WavEffect(soundSystem, info.Path.Absolute, info.Loop, info.Volume);
            }
            else if (info.Type == AudioType.NSF)
            {
                sound = new NsfEffect(sfx, info.NsfTrack, info.Priority, info.Loop);
            }
            else
            {
                return(info.Name);
            }

            loadedSounds[info.Name] = sound;
            return(info.Name);
        }
示例#2
0
        public string EffectFromInfo(SoundInfo info)
        {
            if (loadedSounds.ContainsKey(info.Name)) return info.Name;

            ISoundEffect sound;
            if (info.Type == AudioType.Wav)
            {
                sound = new WavEffect(soundSystem, info.Path.Absolute, info.Loop, info.Volume);
            }
            else if (info.Type == AudioType.NSF)
            {
                sound = new NsfEffect(sfx, info.NsfTrack, info.Priority, info.Loop);
            }
            else return info.Name;

            loadedSounds[info.Name] = sound;
            return info.Name;
        }