Пример #1
0
 public void AddPatch(Patch p)
 {
     patches.Add(p);
     p.Channel = this;
 }
Пример #2
0
 public void ReadChunk(string id, long length, DarkInStream s)
 {
     if (id.Equals("CLIP"))
     {
         Clip c = new Clip();
         c.Read(s);
         AddClip(c);
     }
     else if (id.Equals("PTCH"))
     {
         Patch p = new Patch(s);
         AddPatch(p);
     }
 }
Пример #3
0
 public void RemovePatch(Patch p)
 {
     if (patches.Remove(p))
     {
         p.Channel = null;
     }
 }
Пример #4
0
 void patchItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     string file = (string)e.ClickedItem.Tag;
     if (file == null)
     {
         return;
     }
     DarkInStream s = new DarkInStream(File.OpenRead(file));
     s.ReadChunk(delegate(string id, long length, DarkInStream s1)
     {
         if (id.Equals("PTCH"))
         {
             Patch p = new Patch(s);
             p.Channel = selectedChannel;
             foreach (MidiMessage m in p.Get())
             {
                 MidiMessage m2 = m;
                 Sequencer.PlayMidiEvent(m2, true);
             }
         }
     });
     s.Close();
 }