Skip to content

Commit

Permalink
use LibreMidiAccess in ktmidi-ci-tool.
Browse files Browse the repository at this point in the history
  • Loading branch information
atsushieno committed Aug 26, 2024
1 parent 12b3677 commit f8af528
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ktmidi-ci-tool/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ kotlin {
implementation(compose.desktop.currentOs)
implementation(project(":ktmidi-jvm-desktop"))
implementation(libs.mpfilepicker)
// without this, jnirtmidi.so will not be found at runtime.
// without this, jnirtmidi.so and jnilibremidi.so will not be found at runtime.
api(libs.rtmidi.javacpp.platform)
api(libs.libremidi.javacpp.platform)
implementation(libs.kotlinx.coroutines.swing)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class MidiDeviceManager {
virtualMidiOutput2 = midiAccessValue.createVirtualInputSender(pcIn2)
} catch (ex: Exception) {
println(ex)
ex.printStackTrace()
}
}

Expand Down
8 changes: 6 additions & 2 deletions ktmidi-ci-tool/src/desktopMain/kotlin/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ import java.io.File
fun main(args: Array<String>) = application {
initializeAppModel(this)
AppModel.midiDeviceManager.midiAccess =
/*
if (File("/dev/snd/seq").exists()) AlsaMidiAccess()
else if (args.contains("jvm")) JvmMidiAccess()
else if (System.getProperty("os.name").contains("Windows")) JvmMidiAccess()
else RtMidiAccess() // rtmidi-javacpp does not support Windows build nowadays.
/*
*/
LibreMidiAccess.create(MidiTransportProtocol.MIDI1)
/*
MergedMidiAccess("LibreMidi1+2", listOf(
LibreMidiAccess.create(MidiTransportProtocol.UMP),
LibreMidiAccess.create(MidiTransportProtocol.MIDI1)
))*/
))
*/
Window(onCloseRequest = ::exitApplication,
state = rememberWindowState(),
title = "midi-ci-tool") {
Expand Down

0 comments on commit f8af528

Please sign in to comment.