Ejemplo n.º 1
0
 protected Trigger(System.Xml.XmlReader reader)
 {
     StopMusic       = reader.GetBooleanAttribute("stopMusic");
     StopSounds      = reader.GetBooleanAttribute("stopSounds");
     TargetElementId = reader.GetIntegerAttribute("targetId");
     CrossFadeMusic  = reader.GetBooleanAttributeOrDefault("crossFadeMusic", false);
     FadeMusic       = reader.GetBooleanAttributeOrDefault("fadeMusic", false);
     FadeMusicTime   = reader.GetIntegerAttributeOrDefault("crossFadeMusicTime", 0);
     FadeSounds      = reader.GetBooleanAttributeOrDefault("fadeSounds", false);
     FadeSoundTime   = reader.GetIntegerAttributeOrDefault("fadeSoundTime", 0);
 }
Ejemplo n.º 2
0
        protected ElementBase(System.Xml.XmlReader reader)
        {
            m_ID            = reader.GetIntegerAttribute("Id");
            Title           = reader.GetNonEmptyAttribute("Title");
            SetsMusicVolume = reader.GetBooleanAttributeOrDefault("SetsMusicVolume", false);
            SetsSoundVolume = reader.GetBooleanAttributeOrDefault("SetsSoundVolume", false);
            MusicVolume     = reader.GetIntegerAttributeOrDefault("MusicVolume", 100);
            if (MusicVolume < 0 || MusicVolume > 100)
            {
                XmlHelpers.ThrowException(StringResources.InvalidVolume, reader);
            }
            SoundVolume = reader.GetIntegerAttributeOrDefault("SoundVolume", 100);
            if (SoundVolume < 0 || SoundVolume > 100)
            {
                XmlHelpers.ThrowException(StringResources.InvalidVolume, reader);
            }

            DataModule.TheElementRepository.AddElement(ref m_ID, this);
            DataModule.TheElementFactory.UpdateNextID(m_ID);
        }
Ejemplo n.º 3
0
        internal MusicByTags(System.Xml.XmlReader reader)
            : base(reader)
        {
            m_Tags = new Dictionary <int, HashSet <int> >();
            bool isOperatorAnd          = reader.GetBooleanAttributeOrDefault("IsOperatorAnd", true);
            int  tagCategoryCombination = reader.GetIntegerAttributeOrDefault("TagCategoryCombination", -1);

            if (tagCategoryCombination >= (int)Data.TagCategoryCombination.UseAnyTag && tagCategoryCombination <= (int)Data.TagCategoryCombination.UseAllTags)
            {
                TagCategoryCombination = (Data.TagCategoryCombination)tagCategoryCombination;
            }
            else
            {
                TagCategoryCombination = isOperatorAnd ? Data.TagCategoryCombination.UseOneTagOfEachCategory : Data.TagCategoryCombination.UseAnyTag;
            }
            FadeTime = reader.GetIntegerAttributeOrDefault("FadeTime", 0);
            if (reader.IsEmptyElement)
            {
                XmlHelpers.ThrowException(StringResources.ExpectedContent, reader);
            }
            reader.Read();
            while (reader.IsStartElement())
            {
                if (reader.IsStartElement("Tags") && !reader.IsEmptyElement)
                {
                    reader.Read();
                    while (reader.IsStartElement())
                    {
                        if (reader.IsStartElement("Tag"))
                        {
                            int category = reader.GetIntegerAttribute("Category");
                            int tag      = reader.GetIntegerAttribute("Tag");
                            AddTag(category, tag);
                            reader.ReadOuterXml();
                        }
                        else
                        {
                            reader.ReadOuterXml();
                        }
                    }
                    reader.ReadEndElement();
                }
                else
                {
                    reader.ReadOuterXml();
                }
            }
            reader.ReadEndElement();
        }
Ejemplo n.º 4
0
 internal ModeElement(System.Xml.XmlReader reader)
     : base(reader)
 {
     // IsPlaying = false;
     IsVisibleInPlayer = reader.GetBooleanAttributeOrDefault("visibleInPlayer", true);
     if (!reader.IsEmptyElement)
     {
         reader.Read();
         StartElement = DataModule.TheElementFactory.CreateElement(reader);
         m_Trigger    = DataModule.TheElementFactory.CreateTrigger(reader);
         reader.ReadEndElement();
     }
     else
     {
         reader.Read();
     }
 }
Ejemplo n.º 5
0
 protected override void ReadSubclassAttributes(System.Xml.XmlReader reader)
 {
     ShowAlbumColumn  = reader.GetBooleanAttributeOrDefault("ShowAlbumColumn", false);
     ShowArtistColumn = reader.GetBooleanAttributeOrDefault("ShowArtistColumn", false);
 }