diff --git a/PlayWallPluginNativeAudio/src/main/resources/Test-Sound.wav b/PlayWall/src/main/resources/Test-Sound.wav similarity index 100% rename from PlayWallPluginNativeAudio/src/main/resources/Test-Sound.wav rename to PlayWall/src/main/resources/Test-Sound.wav diff --git a/PlayWallPluginNativeAudio/pom.xml b/PlayWallPluginNativeAudio/pom.xml index 957b76eb1f385be78338e278d3e4ec61d625afaf..23d82fcce88ddd745308bba9006a1c754e252e27 100644 --- a/PlayWallPluginNativeAudio/pom.xml +++ b/PlayWallPluginNativeAudio/pom.xml @@ -106,6 +106,15 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <archive> + <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile> + </archive> + </configuration> + </plugin> </plugins> </build> diff --git a/PlayWallPluginNativeAudio/src/main/java/de/tobias/playpad/audio/windows/NativeAudioSettingsViewController.java b/PlayWallPluginNativeAudio/src/main/java/de/tobias/playpad/audio/windows/NativeAudioSettingsViewController.java index 6ac00cebe8a99a7ea614046b95c3b8b25623e61e..e1c0b265caae0a6a8c0e32ade092943accc4c334 100644 --- a/PlayWallPluginNativeAudio/src/main/java/de/tobias/playpad/audio/windows/NativeAudioSettingsViewController.java +++ b/PlayWallPluginNativeAudio/src/main/java/de/tobias/playpad/audio/windows/NativeAudioSettingsViewController.java @@ -19,7 +19,7 @@ import java.nio.file.Path; public class NativeAudioSettingsViewController extends AudioHandlerViewController { - private static final String TEST_SOUND_WAV = "Test-Sound.wav"; + private static final String TEST_SOUND_WAV = "Test-Sound.wav"; @FXML private ComboBox<String> soundCardComboBox; @@ -31,7 +31,7 @@ public class NativeAudioSettingsViewController extends AudioHandlerViewControlle private NativeAudio audioPlayer; NativeAudioSettingsViewController() { - super("nawinSettings", "de/tobias/playpad/assets/win/", null); + super("nawinSettings", "win", null); testButton.setGraphic(new FontIcon(FontAwesomeType.PLAY)); @@ -74,11 +74,11 @@ public class NativeAudioSettingsViewController extends AudioHandlerViewControlle @FXML private void testButtonHandler(ActionEvent event) { - final App app = ApplicationUtils.getApplication(); - Path file = app.getPath(PathType.RESOURCES, TEST_SOUND_WAV); - app.getClasspathResource("Test-Sound.wav").copy(PathType.RESOURCES, "TestSound.wav"); - if (audioPlayer == null) { + final App app = ApplicationUtils.getApplication(); + Path file = app.getPath(PathType.RESOURCES, TEST_SOUND_WAV); + app.getClasspathResource(TEST_SOUND_WAV).copy(PathType.RESOURCES, TEST_SOUND_WAV); + audioPlayer = new NativeAudio(); audioPlayer.load(file.toString()); audioPlayer.setDevice(soundCardComboBox.getValue()); diff --git a/PlayWallPluginNativeAudio/src/main/resources/META-INF/MANIFEST.MF b/PlayWallPluginNativeAudio/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 0000000000000000000000000000000000000000..91ad6b0b4369b0d7c6ebe84300dec5f55e3a3b97 --- /dev/null +++ b/PlayWallPluginNativeAudio/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: . NativeAudio/jni4net.j-0.8.8.0.jar NativeAudio/NativeAudio.j4n.jar + diff --git a/PlayWallPluginNativeAudio/src/main/scala/de/tobias/playpad/plugin/loader/WindowsAudioImplLoader.scala b/PlayWallPluginNativeAudio/src/main/scala/de/tobias/playpad/plugin/loader/WindowsAudioImplLoader.scala index 7769daa5ba2594295c49960cfcea5f157954afff..f490fb40b11bc5337283adb1cca6411c28ff4a83 100644 --- a/PlayWallPluginNativeAudio/src/main/scala/de/tobias/playpad/plugin/loader/WindowsAudioImplLoader.scala +++ b/PlayWallPluginNativeAudio/src/main/scala/de/tobias/playpad/plugin/loader/WindowsAudioImplLoader.scala @@ -18,7 +18,7 @@ class WindowsAudioImplLoader extends AudioModuleLoader { override def preInit(): Unit = { val app: App = ApplicationUtils.getApplication - val resourceFolder = app.getPath(PathType.NATIVE_LIBRARY) + val resourceFolder = app.getPath(PathType.LIBRARY, "NativeAudio") if (!app.isDebug) { if (Files.notExists(resourceFolder)) @@ -34,8 +34,8 @@ class WindowsAudioImplLoader extends AudioModuleLoader { } Bridge.setVerbose(app isDebug) - Bridge.init() - Bridge.LoadAndRegisterAssemblyFrom(resourceFolder.resolve("NativeAudio.j4n.dll").toFile) + Bridge.init(resourceFolder toFile) + Bridge.LoadAndRegisterAssemblyFrom(resourceFolder.resolve("NativeAudio.j4n.dll") toFile) } override def init(module: Module): Unit = {