Skip to content
Snippets Groups Projects
Commit 4f8e766c authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Fixed bugs (duplicate project, setVolume NativeWin)

parent 427c696e
No related branches found
No related tags found
No related merge requests found
...@@ -61,8 +61,8 @@ public final class ProjectReferences { ...@@ -61,8 +61,8 @@ public final class ProjectReferences {
} }
private static void duplicateFiles(ProjectReference currentProject, ProjectReference newProjectReference) throws IOException { private static void duplicateFiles(ProjectReference currentProject, ProjectReference newProjectReference) throws IOException {
Path oldPath = ApplicationUtils.getApplication().getPath(PathType.DOCUMENTS, currentProject.getName()); Path oldPath = currentProject.getProjectPath();
Path newPath = ApplicationUtils.getApplication().getPath(PathType.DOCUMENTS, newProjectReference.getName()); Path newPath = newProjectReference.getProjectPath();
Files.copy(oldPath, newPath, StandardCopyOption.COPY_ATTRIBUTES); Files.copy(oldPath, newPath, StandardCopyOption.COPY_ATTRIBUTES);
} }
......
...@@ -32,7 +32,8 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable ...@@ -32,7 +32,8 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable
private static final int SLEEP_TIME_POSITION = 50; private static final int SLEEP_TIME_POSITION = 50;
static { static {
positionThread = new Thread(() -> { positionThread = new Thread(() ->
{
while (true) { while (true) {
try { try {
if (playedHandlers.isEmpty()) { if (playedHandlers.isEmpty()) {
...@@ -136,8 +137,10 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable ...@@ -136,8 +137,10 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable
@Override @Override
public void setVolume(double volume) { public void setVolume(double volume) {
if (audioHandler != null) {
audioHandler.setVolume((float) volume); audioHandler.setVolume((float) volume);
} }
}
@Override @Override
public boolean isMediaLoaded() { public boolean isMediaLoaded() {
...@@ -146,7 +149,8 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable ...@@ -146,7 +149,8 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable
@Override @Override
public void loadMedia(Path[] paths) { public void loadMedia(Path[] paths) {
Platform.runLater(() -> { Platform.runLater(() ->
{
if (getContent().getPad().isPadVisible()) { if (getContent().getPad().isPadVisible()) {
getContent().getPad().getController().getView().showBusyView(true); getContent().getPad().getController().getView().showBusyView(true);
} }
...@@ -155,11 +159,11 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable ...@@ -155,11 +159,11 @@ public class NativeAudioWinHandler extends AudioHandler implements Soundcardable
audioHandler = new NativeAudio(); audioHandler = new NativeAudio();
audioHandler.load(paths[0].toString()); audioHandler.load(paths[0].toString());
String name = (String) Profile.currentProfile().getProfileSettings().getAudioUserInfo() String name = (String) Profile.currentProfile().getProfileSettings().getAudioUserInfo().get(NativeAudioWinHandler.SOUND_CARD);
.get(NativeAudioWinHandler.SOUND_CARD);
audioHandler.setDevice(name); audioHandler.setDevice(name);
Platform.runLater(() -> { Platform.runLater(() ->
{
durationProperty.set(Duration.millis(audioHandler.getDuration())); durationProperty.set(Duration.millis(audioHandler.getDuration()));
getContent().getPad().setStatus(PadStatus.READY); getContent().getPad().setStatus(PadStatus.READY);
if (getContent().getPad().isPadVisible()) { if (getContent().getPad().isPadVisible()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment