-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an initial version of the MIDI bridge
- Loading branch information
1 parent
7947365
commit 0edeb78
Showing
4 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
]) | ||
} |
22 changes: 22 additions & 0 deletions
22
...idge-midi/src/main/java/io/github/roboblazers7617/buttonbox/controls/TestControlMIDI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |