Skip to content

Commit

Permalink
Update ButtonBox to use the new PhysicalControl API
Browse files Browse the repository at this point in the history
  • Loading branch information
CoffeeCoder1 committed Nov 19, 2024
1 parent 9e804b7 commit a4093bb
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import javax.sound.midi.ShortMessage;

import io.github.roboblazers7617.buttonbox.ButtonBoxClient;
import io.github.roboblazers7617.buttonbox.controls.TestControlMIDI;
import io.github.roboblazers7617.buttonbox.controls.ButtonMIDI;
import io.github.roboblazers7617.buttonbox.controls.PhysicalTestControl;
import io.github.roboblazers7617.buttonbox.controls.PhysicalButton;
import io.github.roboblazers7617.buttonbox.midi.MIDIDevice;
import io.github.roboblazers7617.buttonbox.midi.MIDIAddress;

Expand Down Expand Up @@ -88,13 +88,13 @@ public void run() throws MidiUnavailableException {
*/
private void configureControls(ButtonBoxClient client, MIDIDevice midiDevice) {
// Test controls
client.addControl(new TestControlMIDI("Test Control", new MIDIAddress(midiDevice, ShortMessage.CONTROL_CHANGE, 1, 0)));
client.addControl(new ButtonMIDI("Test Button", new MIDIAddress(midiDevice, ShortMessage.NOTE_ON, 1, 0)));
client.addControl(new PhysicalTestControl("Test Control", new MIDIAddress(midiDevice, ShortMessage.CONTROL_CHANGE, 1, 0)));
client.addControl(new PhysicalButton("Test Button", new MIDIAddress(midiDevice, ShortMessage.NOTE_ON, 1, 0)));

// Head controls
client.addControl(new ButtonMIDI("Shoot Button", new MIDIAddress(midiDevice, ShortMessage.NOTE_ON, 0, 0)));
client.addControl(new ButtonMIDI("Intake Button Ground", new MIDIAddress(midiDevice, ShortMessage.NOTE_ON, 0, 1)));
client.addControl(new ButtonMIDI("Intake Button Source", new MIDIAddress(midiDevice, ShortMessage.NOTE_ON, 0, 2)));
client.addControl(new ButtonMIDI("Outake Button", new MIDIAddress(midiDevice, ShortMessage.NOTE_ON, 0, 3)));
client.addControl(new PhysicalButton("Shoot Button", new MIDIAddress(midiDevice, ShortMessage.NOTE_ON, 0, 0)));
client.addControl(new PhysicalButton("Intake Button Ground", new MIDIAddress(midiDevice, ShortMessage.NOTE_ON, 0, 1)));
client.addControl(new PhysicalButton("Intake Button Source", new MIDIAddress(midiDevice, ShortMessage.NOTE_ON, 0, 2)));
client.addControl(new PhysicalButton("Outake Button", new MIDIAddress(midiDevice, ShortMessage.NOTE_ON, 0, 3)));
}
}

0 comments on commit a4093bb

Please sign in to comment.