Skip to content

Commit

Permalink
Added notes on javacpp-platform Gradle plugin on README.
Browse files Browse the repository at this point in the history
Context: #79 (comment)
  • Loading branch information
atsushieno committed May 23, 2024
1 parent cdfa617 commit 1e5022e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,27 @@ If you want to bring better user experience on desktop (which @atsushieno recomm


```
plugins { // skip this if you are rather building a library (not an app)
id("org.bytedeco.gradle-javacpp-platform") version "1.5.10"
}
dependencies {
implementation "dev.atsushieno:ktmidi-jvm-desktop:+" // replace + with the actual version
}
```

... and use `AlsaMidiAccess` on Linux, or `RtMidiAccess` elsewhere. I use `if (File.exists("/dev/snd/seq")) AlsaMidiAccess() else RtMidiAccess()` (or `JvmMidiAccess` instead of `RtMidiAccess`) to create best `MidiAccess` instance.

**NOTE**: if you are building a desktop MIDI library using `ktmidi-jvm-desktop`, your *application* needs to add javacpp-platform Gradle plugin:

```
plugins {
id("org.bytedeco.gradle-javacpp-platform") version "1.5.10"
}
```

This Gradle plugin replaces the reference to javacpp library with the platform-specific ones. So if you do this in your *library* build, it will result in that your library is useful only on the same platform as your building environment(!)

ktmidi is released at sonatype and hence available at Maven Central.

## Platform Access API
Expand Down

0 comments on commit 1e5022e

Please sign in to comment.