Пример #1
0
 public BasicSynth(XmlNode element)
 {
     Name = element.Attributes["name"].Value;
     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];
     }
     foreach (XmlNode ch in element.ChildNodes)
     {
         if (ch.Name == "Oscillator")
         {
             oscillators.Add(new Oscillator(ch));
         }
     }
     oscillators.CollectionChanged += Oscillators_CollectionChanged;
 }
Пример #2
0
 public BasicPercussion(XmlNode element)
 {
     elements.CollectionChanged += elements_CollectionChanged;
     Name = element.Attributes["name"].Value;
     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];
     }
     foreach (XmlNode ch in element.ChildNodes)
     {
         if (ch.Name == "BasicPercussionElement")
         {
             var BPElem  = new BasicPercussionElement(ch);
             var pitches = ch.Attributes["pitches"].Value.Split(',').Select(x => int.Parse(x.Trim()));
             foreach (var x in pitches)
             {
                 pitchesToElement.Add(x, BPElem);
             }
             elements.Add(BPElem);
         }
     }
 }
Пример #3
0
 public BasicSynth()
 {
     oscillators.Add(new Oscillator());
     oscillators.CollectionChanged += Oscillators_CollectionChanged;
     try
     {
         SoundLine = Project.current.lines[0];
     }
     catch
     {
         SoundLine = null;
     }
 }
Пример #4
0
        public VSTi(XmlNode xml)
        {
            Name = xml.Attributes["name"].Value;
            if (xml.Attributes["soundLine"] != null)
            {
                var number = uint.Parse(xml.Attributes["soundLine"].Value);
                if (number >= Project.current.lines.Count)
                {
                    throw new BadFileException();
                }
                SoundLine = Project.current.lines[(int)number];
            }
            else
            {
                SoundLine = Project.current.lines[0];
            }

            filename = xml.Attributes["filename"].Value;
            startProcess();
        }
Пример #5
0
 public SoundLineConnection(int lineNumberOutput, SoundLineAbstract input, float volume)
 {
     this.output = Project.current.lines[lineNumberOutput];
     this.input  = input;
     this.volume = volume;
 }