public Form1() { InitializeComponent(); try { device = new LaunchpadDevice(); device.DoubleBuffered = true; } catch { textBox2.Text = ("Launchpad nicht angeschlossen, oder durch ein anderes Programm verwendet!"); return; } for (int y = 0; y < 8; y++) for (int x = 0; x < 8; x++) device[x, y].TurnOffLight(); device.GetButton(ToolbarButton.Session).SetBrightness(ButtonBrightness.Off, ButtonBrightness.Off); device.GetButton(ToolbarButton.Left).SetBrightness(ButtonBrightness.Off, ButtonBrightness.Off); device.GetButton(ToolbarButton.User1).SetBrightness(ButtonBrightness.Off, ButtonBrightness.Off); device.GetButton(ToolbarButton.User2).SetBrightness(ButtonBrightness.Off, ButtonBrightness.Off); device.GetButton(ToolbarButton.Mixer).SetBrightness(ButtonBrightness.Off, ButtonBrightness.Off); device.Reset(); button1.Enabled = true; button2.Enabled = false; button2.Text = "Launchpad erkannt"; hilfe(); }
public ToggleGrid(LaunchpadDevice device) { mLaunchpadDevice = device; mLaunchpadDevice.DoubleBuffered = false; mLaunchpadDevice.ButtonPressed += mLaunchpadDevice_ButtonPressed; mLaunchpadDevice.GetButton(ToolbarButton.Session).SetBrightness(ButtonBrightness.Full, ButtonBrightness.Full); /* for (int y = 0; y < 4; y++) { for (int x = 0; x < 4; x++) { mLaunchpadDevice[x, y].SetBrightness((ButtonBrightness)x, (ButtonBrightness)y); } } */ }
public Schach(TextBox TextBox2, TextBox TextBox1, LaunchpadDevice device, PictureBox PicBoxx, PictureBox a1, PictureBox a2, PictureBox a3, PictureBox a4, PictureBox a5, PictureBox a6, PictureBox a7, PictureBox a8, PictureBox b1, PictureBox b2, PictureBox b3, PictureBox b4, PictureBox b5, PictureBox b6, PictureBox b7, PictureBox b8, PictureBox c1, PictureBox c2, PictureBox c3, PictureBox c4, PictureBox c5, PictureBox c6, PictureBox c7, PictureBox c8, PictureBox d1, PictureBox d2, PictureBox d3, PictureBox d4, PictureBox d5, PictureBox d6, PictureBox d7, PictureBox d8, PictureBox e1, PictureBox e2, PictureBox e3, PictureBox e4, PictureBox e5, PictureBox e6, PictureBox e7, PictureBox e8, PictureBox f1, PictureBox f2, PictureBox f3, PictureBox f4, PictureBox f5, PictureBox f6, PictureBox f7, PictureBox f8, PictureBox g1, PictureBox g2, PictureBox g3, PictureBox g4, PictureBox g5, PictureBox g6, PictureBox g7, PictureBox g8, PictureBox h1, PictureBox h2, PictureBox h3, PictureBox h4, PictureBox h5, PictureBox h6, PictureBox h7, PictureBox h8) { initialisieren(); pa1 = a1; pa2 = a2; pa3 = a3; pa4 = a4; pa5 = a5; pa6 = a6; pa7 = a7; pa8 = a8; pb1 = b1; pb2 = b2; pb3 = b3; pb4 = b4; pb5 = b5; pb6 = b6; pb7 = b7; pb8 = b8; pc1 = c1; pc2 = c2; pc3 = c3; pc4 = c4; pc5 = c5; pc6 = c6; pc7 = c7; pc8 = c8; pd1 = d1; pd2 = d2; pd3 = d3; pd4 = d4; pd5 = d5; pd6 = d6; pd7 = d7; pd8 = d8; pe1 = e1; pe2 = e2; pe3 = e3; pe4 = e4; pe5 = e5; pe6 = e6; pe7 = e7; pe8 = e8; pf1 = f1; pf2 = f2; pf3 = f3; pf4 = f4; pf5 = f5; pf6 = f6; pf7 = f7; pf8 = f8; pg1 = g1; pg2 = g2; pg3 = g3; pg4 = g4; pg5 = g5; pg6 = g6; pg7 = g7; pg8 = g8; ph1 = h1; ph2 = h2; ph3 = h3; ph4 = h4; ph5 = h5; ph6 = h6; ph7 = h7; ph8 = h8; mLaunchpadDevice = device; PictureBox1 = PicBoxx; mLaunchpadDevice.DoubleBuffered = false; //Geändert..! ausgabe = TextBox2; ausgabetb2 = TextBox1; mLaunchpadDevice.GetButton(ToolbarButton.Mixer).SetBrightness(ButtonBrightness.Full, ButtonBrightness.Full); mLaunchpadDevice.GetButton(ToolbarButton.Session).SetBrightness(ButtonBrightness.Off, ButtonBrightness.Off); spieleranzeige(); launchpadaus(mLaunchpadDevice); showboard(); mLaunchpadDevice.ButtonPressed += mLaunchpadDevice_ButtonPressed; }
////////////////////////// e passant! Rochadenproblem (fressen des Turms) private void button2_Click(object sender, EventArgs e) { try { device = new LaunchpadDevice(); device.DoubleBuffered = true; } catch { textBox2.Text = ("Launchpad nicht angeschlossen, oder durch ein anderes Programm verwendet!"); return; } for (int y = 0; y < 8; y++) for (int x = 0; x < 8; x++) device[x, y].TurnOffLight(); device.GetButton(ToolbarButton.Session).SetBrightness(ButtonBrightness.Off, ButtonBrightness.Off); device.GetButton(ToolbarButton.Left).SetBrightness(ButtonBrightness.Off, ButtonBrightness.Off); device.GetButton(ToolbarButton.User1).SetBrightness(ButtonBrightness.Off, ButtonBrightness.Off); device.GetButton(ToolbarButton.User2).SetBrightness(ButtonBrightness.Off, ButtonBrightness.Off); device.GetButton(ToolbarButton.Mixer).SetBrightness(ButtonBrightness.Off, ButtonBrightness.Off); device.Reset(); Warten warten = new Warten(device); button1.Enabled = true; button2.Enabled = false; button2.Text = "Launchpad erkannt"; hilfe(); }