예제 #1
0
        public OneSample(XmlNode element)
        {
            if (element.Attributes["soundLine"] != null)
            {
                var number = uint.Parse(element.Attributes["soundLine"].Value);
                if (number >= Project.current.lines.Count)
                {
                    throw new BadFileException();
                }
                SoundLine = Project.current.lines[(int)number];
            }
            else
            {
                SoundLine = Project.current.lines[0];
            }


            length      = float.Parse(element.Attributes["length"].Value, CultureInfo.InvariantCulture);
            offset      = float.Parse(element.Attributes["offset"].Value, CultureInfo.InvariantCulture);
            innerOffset = float.Parse(element.Attributes["innerOffset"].Value, CultureInfo.InvariantCulture);
            speed       = float.Parse(element.Attributes["speed"].Value, CultureInfo.InvariantCulture);
            if (element.Attributes["name"] != null)
            {
                Name = element.Attributes["name"].Value;
            }
            sample = SampledSound.FindByUrl(element.Attributes["src"].Value);
        }
예제 #2
0
 public SamplePlayItem(XmlNode element)
 {
     Pitch = float.Parse(element.Attributes["pitch"].Value, CultureInfo.InvariantCulture);
     if (element.Attributes["playToEnd"] != null)
     {
         PlayToEnd = bool.Parse(element.Attributes["playToEnd"].Value);
     }
     if (element.Attributes["r"] != null)
     {
         R = float.Parse(element.Attributes["r"].Value, CultureInfo.InvariantCulture);
     }
     sample = SampledSound.FindByUrl(element.Attributes["src"].Value);
 }