Skip to content

Commit

Permalink
Add an initial version of the MIDI bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
CoffeeCoder1 committed Oct 10, 2024
1 parent 7947365 commit 0edeb78
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
61 changes: 61 additions & 0 deletions buttonbox-bridge-midi/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
plugins {
id "java"
id 'java-library'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id "edu.wpi.first.GradleRIO" version "2024.3.2"
id 'edu.wpi.first.WpilibTools' version '1.3.0'
}

wpilibTools.deps.wpilibVersion = wpi.versions.wpilibVersion.get()

def nativeConfigName = 'wpilibNatives'
def nativeConfig = configurations.create(nativeConfigName)

def nativeTasks = wpilibTools.createExtractionTasks {
configurationName = nativeConfigName
}

nativeTasks.addToSourceSetResources(sourceSets.main)
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath")
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet")
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil")
nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore")
nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore")
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())

dependencies {
implementation wpilibTools.deps.wpilibJava("wpilibNewCommands")
implementation wpilibTools.deps.wpilibJava("wpilibj")
implementation wpilibTools.deps.wpilibJava("wpiutil")
implementation wpilibTools.deps.wpilibJava("wpimath")
implementation wpilibTools.deps.wpilibJava("wpinet")
implementation wpilibTools.deps.wpilibJava("ntcore")
implementation wpilibTools.deps.wpilibJava("cscore")
implementation wpilibTools.deps.wpilibJava("cameraserver")
implementation wpilibTools.deps.wpilibJava("hal")

implementation wpilibTools.deps.wpilibOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())

implementation group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: wpi.versions.jacksonVersion.get()
implementation group: "com.fasterxml.jackson.core", name: "jackson-core", version: wpi.versions.jacksonVersion.get()
implementation group: "com.fasterxml.jackson.core", name: "jackson-databind", version: wpi.versions.jacksonVersion.get()

implementation group: "org.ejml", name: "ejml-simple", version: wpi.versions.ejmlVersion.get()
implementation group: "us.hebi.quickbuf", name: "quickbuf-runtime", version: wpi.versions.quickbufVersion.get();

implementation(project(':buttonbox-lib'));
}

shadowJar {
archiveBaseName = "ButtonBoxBridgeMIDI"
archiveVersion = ""
exclude("module-info.class")
archiveClassifier.set(wpilibTools.currentPlatform.platformName)
}

// Build javadoc
tasks.withType(Javadoc) {
options.setLinks([
"https://github.wpilib.org/allwpilib/docs/release/java",
])
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.github.roboblazers7617.buttonbox.controls;

/**
* A test {@link io.github.roboblazers7617.buttonbox.Control} that reads the data published by a {@link io.github.roboblazers7617.buttonbox.controls.TestControl} and outputs it as MIDI messages.
*/
public class TestControlMIDI extends TestControl {
/**
* Creates a new TestControlMIDI.
*
* @param id
* The ID string for the TestControlMIDI to use.
* @see io.github.roboblazers7617.buttonbox.Control
*/
public TestControlMIDI(String id) {
super(id);
}

@Override
public void updateHardware() {
System.out.println(getValue());
}
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ pluginManagement {
rootProject.name = 'buttonbox'
include 'buttonbox-lib'
include 'buttonbox-bridge'
include 'buttonbox-bridge-midi'
1 change: 1 addition & 0 deletions tshirt-launcher-test-build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
./gradlew build
cp buttonbox-lib/build/libs/buttonbox-lib.jar ../TShirtLauncher/libs
cp buttonbox-bridge-midi/build/libs/buttonbox-bridge-midi.jar ../TShirtLauncher/libs
cd ../TShirtLauncher
./buttonbox-simulate.sh

0 comments on commit 0edeb78

Please sign in to comment.