Ejemplo n.º 1
0
 public void AddMessage(SynthWaveProvider.Message msg)
 {
     lock (synth_provider.lockObj)
     {
         synth_provider.msgQueue.Enqueue(msg);
     }
 }
Ejemplo n.º 2
0
 private void pictureBox3_Click(object sender, EventArgs e)
 {
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     msg.channel = 0;
     msg.command = 15;
     msg.data1   = Math.Max(0, trackBar1.Value - trackBar1.TickFrequency);
     msg.type    = SynthWaveProvider.MessageType.Synth;
     ((MainForm)this.ParentForm).AddMessage(msg);
 }
Ejemplo n.º 3
0
 private void button2_Click(object sender, EventArgs e)
 {
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     msg.type    = SynthWaveProvider.MessageType.Midi;
     msg.channel = Channel;
     msg.command = 0xB0;
     msg.data1   = 0x79;
     msg.data2   = 0;
     ((MainForm)this.MdiParent).AddMessage(msg);
 }
Ejemplo n.º 4
0
 private void keyBoardControl1_PianoKey_Up(int key)
 {
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     msg.type    = SynthWaveProvider.MessageType.Midi;
     msg.channel = Channel;
     msg.command = 0x80;
     msg.data1   = key;
     msg.data2   = 64;
     ((MainForm)this.MdiParent).AddMessage(msg);
 }
 private void button1_Click(object sender, EventArgs e)
 {
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     msg.type = SynthWaveProvider.MessageType.Midi;
     msg.channel = Channel;
     msg.command = 0xB0;
     msg.data1 = 0x7B;
     msg.data2 = 0;
     ((MainForm)this.MdiParent).AddMessage(msg);
 }
Ejemplo n.º 6
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex < 0)
     {
         return;
     }
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     msg.type    = SynthWaveProvider.MessageType.Midi;
     msg.channel = Channel;
     msg.command = 0xC0;
     msg.data1   = comboBox1.SelectedIndex;
     msg.data2   = 0;
     ((MainForm)this.MdiParent).AddMessage(msg);
 }
Ejemplo n.º 7
0
 private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)
 {
     if (e.NewValue == e.OldValue)
     {
         return;
     }
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     msg.channel = 0;
     msg.command = 10;
     msg.data1   = hScrollBar1.Value;
     msg.data2   = hScrollBar1.Maximum;
     msg.type    = SynthWaveProvider.MessageType.Synth;
     ((MainForm)this.ParentForm).AddMessage(msg);
 }
Ejemplo n.º 8
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {//set mute
            MainForm mf = (MainForm)this.MdiParent;

            SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
            PictureBox pic = (PictureBox)sender;

            msg.channel = int.Parse(pic.Tag.ToString());
            if (mf.ismuted(msg.channel))
            {
                msg.command = 21;
                pic.Image   = Properties.Resources.unmute;
            }
            else
            {
                msg.command = 20;
                pic.Image   = Properties.Resources.mute;
            }
            mf.AddMessage(msg);
        }
Ejemplo n.º 9
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {//set hold
            MainForm mf = (MainForm)this.MdiParent;

            SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
            PictureBox pic = (PictureBox)sender;

            msg.type    = SynthWaveProvider.MessageType.Midi;
            msg.channel = int.Parse(pic.Tag.ToString());
            msg.command = 0xB0;
            msg.data1   = 0x40;
            if (mf.isholding(msg.channel))
            {
                msg.data2 = 0;
                pic.Image = Properties.Resources.holdoff;
            }
            else
            {
                msg.data2 = 127;
                pic.Image = Properties.Resources.holdon;
            }
            mf.AddMessage(msg);
        }
 private void pictureBox2_Click(object sender, EventArgs e)
 {//set hold
     MainForm mf = (MainForm)this.MdiParent;
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     PictureBox pic = (PictureBox)sender;
     msg.type = SynthWaveProvider.MessageType.Midi;
     msg.channel = int.Parse(pic.Tag.ToString());
     msg.command = 0xB0;
     msg.data1 = 0x40;
     if (mf.isholding(msg.channel))
     {
         msg.data2 = 0;
         pic.Image = Properties.Resources.holdoff;
     }
     else
     {
         msg.data2 = 127;
         pic.Image = Properties.Resources.holdon;
     }
     mf.AddMessage(msg);
 }
 private void pictureBox1_Click(object sender, EventArgs e)
 {//set mute
     MainForm mf = (MainForm)this.MdiParent;
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     PictureBox pic = (PictureBox)sender;
     msg.channel = int.Parse(pic.Tag.ToString());
     if (mf.ismuted(msg.channel))
     {
         msg.command = 21;
         pic.Image = Properties.Resources.unmute;
     }
     else
     {
         msg.command = 20;
         pic.Image = Properties.Resources.mute;
     }
     mf.AddMessage(msg);
 }
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex < 0)
         return;
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     msg.type = SynthWaveProvider.MessageType.Midi;
     msg.channel = Channel;
     msg.command = 0xC0;
     msg.data1 = comboBox1.SelectedIndex;
     msg.data2 = 0;
     ((MainForm)this.MdiParent).AddMessage(msg);
 }     
 private void keyBoardControl1_PianoKey_Up(int key)
 {
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     msg.type = SynthWaveProvider.MessageType.Midi;
     msg.channel = Channel;
     msg.command = 0x80;
     msg.data1 = key;
     msg.data2 = 64;
     ((MainForm)this.MdiParent).AddMessage(msg);
 }
 private void pictureBox3_Click(object sender, EventArgs e)
 {
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     msg.channel = 0;
     msg.command = 15;
     msg.data1 = Math.Max(0, trackBar1.Value - trackBar1.TickFrequency);
     msg.type = SynthWaveProvider.MessageType.Synth;
     ((MainForm)this.ParentForm).AddMessage(msg);
 }
 private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)
 {
     if (e.NewValue == e.OldValue)
         return;
     SynthWaveProvider.Message msg = new SynthWaveProvider.Message();
     msg.channel = 0;
     msg.command = 10;
     msg.data1 = hScrollBar1.Value;
     msg.data2 = hScrollBar1.Maximum;
     msg.type = SynthWaveProvider.MessageType.Synth;
     ((MainForm)this.ParentForm).AddMessage(msg);
 }
Ejemplo n.º 16
0
 public void AddMessage(SynthWaveProvider.Message msg)
 {
     lctrl.addString(msg.ToString() + "\n");
     sthread.AddMessage(msg);
 }