示例#1
0
        /// <summary>
        /// Incrementally build up the tree from a SoundModifier.
        /// </summary>
        /// <param name="soundMod"></param>
        /// <returns></returns>
        private bool AddSoundModifier(SoundModifier soundMod)
        {
            string groupName = soundMod.group;
            string soundId   = soundMod.upid;
            string soundName = soundMod.sound;

            Group group = FindOrMakeGroup(groupName);

            Sound sound = AddSound(group, soundId, soundName);

            if (sound != null)
            {
                sound.Spatial       = soundMod.spatial;
                sound.VirtualLength = soundMod.vlength;
                sound.Loudness      = soundMod.loudness;
            }
            return(sound != null);
        }
示例#2
0
        /// <summary>
        /// Build up the taxonomy from a list which includes SoundModifiers.
        /// We ignore everything in the list but the SoundModifiers.
        /// </summary>
        /// <param name="groups"></param>
        /// <param name="modifiers"></param>
        /// <returns></returns>
        public bool Build(Dictionary <string, CardSpace.Group> groups, Dictionary <string, Modifier> modifiers)
        {
            this.groups = groups;

            foreach (Modifier mod in modifiers.Values)
            {
                SoundModifier soundMod = mod as SoundModifier;
                if (soundMod != null)
                {
                    AddSoundModifier(soundMod);
                }
            }

            this.groups = null;

            BuildLookup();

            return(true);
        }