diff --git a/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferences.java b/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferences.java index 67fc41d20bc0a588b5a47fbb5616ddbfa54525a1..feabcc448ff93cc1d8ab2697fdc785f57a646054 100644 --- a/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferences.java +++ b/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferences.java @@ -61,8 +61,8 @@ public final class ProjectReferences { } private static void duplicateFiles(ProjectReference currentProject, ProjectReference newProjectReference) throws IOException { - Path oldPath = ApplicationUtils.getApplication().getPath(PathType.DOCUMENTS, currentProject.getName()); - Path newPath = ApplicationUtils.getApplication().getPath(PathType.DOCUMENTS, newProjectReference.getName()); + Path oldPath = currentProject.getProjectPath(); + Path newPath = newProjectReference.getProjectPath(); Files.copy(oldPath, newPath, StandardCopyOption.COPY_ATTRIBUTES); } diff --git a/PlayWallNativeWin/src/de/tobias/playpad/nawin/audio/NativeAudioWinHandler.java b/PlayWallNativeWin/src/de/tobias/playpad/nawin/audio/NativeAudioWinHandler.java index 48c0508bcda7f0318cb90b64976c4725881eb146..5d7853e0ac4d7751c833966b875d3a1a127a53d5 100644 --- a/PlayWallNativeWin/src/de/tobias/playpad/nawin/audio/NativeAudioWinHandler.java +++ b/PlayWallNativeWin/src/de/tobias/playpad/nawin/audio/NativeAudioWinHandler.java @@ -32,7 +32,8 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable private static final int SLEEP_TIME_POSITION = 50; static { - positionThread = new Thread(() -> { + positionThread = new Thread(() -> + { while (true) { try { if (playedHandlers.isEmpty()) { @@ -136,7 +137,9 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable @Override public void setVolume(double volume) { - audioHandler.setVolume((float) volume); + if (audioHandler != null) { + audioHandler.setVolume((float) volume); + } } @Override @@ -146,7 +149,8 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable @Override public void loadMedia(Path[] paths) { - Platform.runLater(() -> { + Platform.runLater(() -> + { if (getContent().getPad().isPadVisible()) { getContent().getPad().getController().getView().showBusyView(true); } @@ -155,11 +159,11 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable audioHandler = new NativeAudio(); audioHandler.load(paths[0].toString()); - String name = (String) Profile.currentProfile().getProfileSettings().getAudioUserInfo() - .get(NativeAudioWinHandler.SOUND_CARD); + String name = (String) Profile.currentProfile().getProfileSettings().getAudioUserInfo().get(NativeAudioWinHandler.SOUND_CARD); audioHandler.setDevice(name); - Platform.runLater(() -> { + Platform.runLater(() -> + { durationProperty.set(Duration.millis(audioHandler.getDuration())); getContent().getPad().setStatus(PadStatus.READY); if (getContent().getPad().isPadVisible()) {