diff --git a/PlayWall/assets/de/tobias/playpad/assets/lang/_de.properties b/PlayWall/assets/de/tobias/playpad/assets/lang/_de.properties index 40f14b9cc603a29514ec065544e572a31a9cce07..6c6afff4663d8077c6057df0050c7caa7e9ac731 100644 --- a/PlayWall/assets/de/tobias/playpad/assets/lang/_de.properties +++ b/PlayWall/assets/de/tobias/playpad/assets/lang/_de.properties @@ -259,6 +259,7 @@ TriggerPoint.EOF_STOP=Ende/Stop # Drag and Drop Mode DnDMode.Replace=Ersetzen +DnDMode.Duplicate=Duplizieren DnDMode.Move=Tauschen # Main Layout diff --git a/PlayWall/src/de/tobias/playpad/RegistryCollectionImpl.java b/PlayWall/src/de/tobias/playpad/RegistryCollectionImpl.java index 12d4b0fe594f1c12be839fa66fd6f129c1424acc..8e9b2bf1773efe28ae50e2bea3f3490bead6e7be 100644 --- a/PlayWall/src/de/tobias/playpad/RegistryCollectionImpl.java +++ b/PlayWall/src/de/tobias/playpad/RegistryCollectionImpl.java @@ -4,7 +4,7 @@ import de.tobias.playpad.action.ActionConnect; import de.tobias.playpad.action.mapper.MapperConnect; import de.tobias.playpad.audio.AudioRegistry; import de.tobias.playpad.design.DesignConnect; -import de.tobias.playpad.pad.PadContentRegistry; +import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.drag.PadDragMode; import de.tobias.playpad.registry.ComponentRegistry; import de.tobias.playpad.registry.DefaultComponentRegistry; diff --git a/PlayWall/src/de/tobias/playpad/Strings.java b/PlayWall/src/de/tobias/playpad/Strings.java index 4e0f3885ebafc33ae6cc2124559fe07443f5f806..4991fd7ab346d117b0be81470a9aa600a914c1f1 100644 --- a/PlayWall/src/de/tobias/playpad/Strings.java +++ b/PlayWall/src/de/tobias/playpad/Strings.java @@ -242,6 +242,7 @@ public class Strings { // Drag and Drop Mode public static final String DnDMode_Move = "DnDMode.Move"; + public static final String DnDMode_Duplicate = "DnDMode.Duplicate"; public static final String DnDMode_Replace = "DnDMode.Replace"; // Main Layout diff --git a/PlayWall/src/de/tobias/playpad/action/cartaction/PadPositionWarningListener.java b/PlayWall/src/de/tobias/playpad/action/cartaction/PadPositionWarningListener.java index 7bd14fdcdc4b151f2a70ab7869209333f9b224e7..c9e3afdfee365576aebdcf81a0da981f39701484 100644 --- a/PlayWall/src/de/tobias/playpad/action/cartaction/PadPositionWarningListener.java +++ b/PlayWall/src/de/tobias/playpad/action/cartaction/PadPositionWarningListener.java @@ -4,7 +4,6 @@ import de.tobias.playpad.action.feedback.FeedbackMessage; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.PadSettings; import de.tobias.playpad.pad.conntent.play.Durationable; -import de.tobias.playpad.settings.Warning; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.util.Duration; @@ -35,13 +34,13 @@ public class PadPositionWarningListener implements ChangeListener<Duration> { // Warning nur wenn kein Loop if (!padSettings.isLoop()) { // Warning - Warning warning = padSettings.getWarning(); + Duration warning = padSettings.getWarning(); Duration totalDuration = durationable.getDuration(); if (totalDuration != null) { Duration rest = totalDuration.subtract(newValue); double seconds = rest.toSeconds(); - if (warning.getTime().toSeconds() > seconds && !send) { + if (warning.toSeconds() > seconds && !send) { action.handleFeedback(FeedbackMessage.WARNING); send = true; } diff --git a/PlayWall/src/de/tobias/playpad/action/cartaction/PadStatusFeedbackListener.java b/PlayWall/src/de/tobias/playpad/action/cartaction/PadStatusFeedbackListener.java index dfafdc97e589aaf83718dd8d2f0e707cfc6bdc12..992dec67bc5dd786c9b14e0cfafc0625159832ea 100644 --- a/PlayWall/src/de/tobias/playpad/action/cartaction/PadStatusFeedbackListener.java +++ b/PlayWall/src/de/tobias/playpad/action/cartaction/PadStatusFeedbackListener.java @@ -5,7 +5,6 @@ import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.PadSettings; import de.tobias.playpad.pad.PadStatus; import de.tobias.playpad.pad.conntent.play.Durationable; -import de.tobias.playpad.settings.Warning; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.util.Duration; @@ -41,11 +40,11 @@ public class PadStatusFeedbackListener implements ChangeListener<PadStatus> { PadSettings padSettings = pad.getPadSettings(); if (!padSettings.isLoop()) { - Warning warning = padSettings.getWarning(); + Duration warning = padSettings.getWarning(); Duration rest = durationable.getDuration().subtract(durationable.getPosition()); double seconds = rest.toSeconds(); - if (warning.getTime().toSeconds() > seconds) { + if (warning.toSeconds() > seconds) { action.handleFeedback(FeedbackMessage.WARNING); } } diff --git a/PlayWall/src/de/tobias/playpad/components/DragMode.xml b/PlayWall/src/de/tobias/playpad/components/DragMode.xml index 11359ce78858ad76de75fe09e03e4c74ff9c78af..3d2b2e610574982028042d5f8a3de259d4c69ac6 100644 --- a/PlayWall/src/de/tobias/playpad/components/DragMode.xml +++ b/PlayWall/src/de/tobias/playpad/components/DragMode.xml @@ -1,4 +1,5 @@ <Actions> <Component id="move">de.tobias.playpad.pad.drag.MoveDragMode</Component> + <Component id="duplicate">de.tobias.playpad.pad.drag.DuplicateDragMode</Component> <Component id="replace">de.tobias.playpad.pad.drag.ReplaceDragMode</Component> </Actions> \ No newline at end of file diff --git a/PlayWall/src/de/tobias/playpad/design/classic/ClassicCartDesign.java b/PlayWall/src/de/tobias/playpad/design/classic/ClassicCartDesign.java index 2e1633288740270b3f8bed32f72f4fb75e97bf67..01f9b4da5cf0abcefa2e75de59261f24c26c8808 100644 --- a/PlayWall/src/de/tobias/playpad/design/classic/ClassicCartDesign.java +++ b/PlayWall/src/de/tobias/playpad/design/classic/ClassicCartDesign.java @@ -17,10 +17,10 @@ import de.tobias.playpad.design.Design; import de.tobias.playpad.design.GlobalDesign; import de.tobias.playpad.pad.view.IPadView; import de.tobias.playpad.pad.viewcontroller.IPadViewController; -import de.tobias.playpad.settings.Warning; import de.tobias.utils.util.ColorXMLUtils; import javafx.application.Platform; import javafx.scene.paint.Color; +import javafx.util.Duration; public class ClassicCartDesign extends Design implements CartDesign { @@ -214,7 +214,7 @@ public class ClassicCartDesign extends Design implements CartDesign { } @Override - public void handleWarning(IPadViewController controller, Warning warning, GlobalDesign layout) { + public void handleWarning(IPadViewController controller, Duration warning, GlobalDesign layout) { final IPadView view = controller.getView(); try { diff --git a/PlayWall/src/de/tobias/playpad/design/classic/ClassicGlobalDesign.java b/PlayWall/src/de/tobias/playpad/design/classic/ClassicGlobalDesign.java index 8052196bfb9df86d3e40fd1c9421950b5c0d6f20..093b7bfc6a5806792442aa6a7e8f3531021136fc 100644 --- a/PlayWall/src/de/tobias/playpad/design/classic/ClassicGlobalDesign.java +++ b/PlayWall/src/de/tobias/playpad/design/classic/ClassicGlobalDesign.java @@ -15,7 +15,6 @@ import de.tobias.playpad.pad.PadSettings; import de.tobias.playpad.pad.view.IPadView; import de.tobias.playpad.pad.viewcontroller.IPadViewController; import de.tobias.playpad.project.Project; -import de.tobias.playpad.settings.Warning; import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.utils.application.ApplicationUtils; import de.tobias.utils.application.container.PathType; @@ -25,6 +24,7 @@ import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.scene.paint.Color; import javafx.stage.Stage; +import javafx.util.Duration; public class ClassicGlobalDesign extends Design implements GlobalDesign { @@ -346,7 +346,7 @@ public class ClassicGlobalDesign extends Design implements GlobalDesign { } @Override - public void handleWarning(IPadViewController controller, Warning warning) { + public void handleWarning(IPadViewController controller, Duration warning) { final IPadView view = controller.getView(); try { diff --git a/PlayWall/src/de/tobias/playpad/design/modern/ModernCartDesign.java b/PlayWall/src/de/tobias/playpad/design/modern/ModernCartDesign.java index 07044edfc0be05608b76ce641a03bd2524c626c7..baa4871b6acf78ca50710ae721270965b8c5f5f5 100644 --- a/PlayWall/src/de/tobias/playpad/design/modern/ModernCartDesign.java +++ b/PlayWall/src/de/tobias/playpad/design/modern/ModernCartDesign.java @@ -11,11 +11,10 @@ import de.tobias.playpad.design.GlobalDesign; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.conntent.play.Durationable; import de.tobias.playpad.pad.viewcontroller.IPadViewController; -import de.tobias.playpad.settings.Warning; import javafx.scene.paint.Color; import javafx.util.Duration; -public class ModernCartDesign extends Design implements CartDesign, DesignColorAssociator { +public class ModernCartDesign extends Design implements CartDesign, DesignColorAssociator, Cloneable { public static final String TYPE = "modern"; @@ -76,7 +75,7 @@ public class ModernCartDesign extends Design implements CartDesign, DesignColorA // Warn Handler -> Animation oder Blinken @Override - public void handleWarning(IPadViewController controller, Warning warning, GlobalDesign layout) { + public void handleWarning(IPadViewController controller, Duration warning, GlobalDesign layout) { if (layout instanceof ModernGlobalDesign && ((ModernGlobalDesign) layout).isWarnAnimation()) { warnAnimation(controller, warning); } else { @@ -89,21 +88,20 @@ public class ModernCartDesign extends Design implements CartDesign, DesignColorA ModernDesignAnimator.stopAnimation(controller); } - private void warnAnimation(IPadViewController controller, Warning warning) { + private void warnAnimation(IPadViewController controller, Duration warning) { FadeableColor stopColor = new FadeableColor(this.backgroundColor.getColorHi(), this.backgroundColor.getColorLow()); FadeableColor playColor = new FadeableColor(this.playColor.getColorHi(), this.playColor.getColorLow()); - Duration warnDuration = warning.getTime(); Pad pad = controller.getPad(); if (pad.getContent() instanceof Durationable) { Duration padDuration = ((Durationable) pad.getContent()).getDuration(); - if (warnDuration.greaterThan(padDuration)) { - warnDuration = padDuration; + if (warning.greaterThan(padDuration)) { + warning = padDuration; } } - ModernDesignAnimator.animateWarn(controller, playColor, stopColor, warnDuration); + ModernDesignAnimator.animateWarn(controller, playColor, stopColor, warning); } // Cart Layout @@ -187,4 +185,12 @@ public class ModernCartDesign extends Design implements CartDesign, DesignColorA return Color.web(backgroundColor.getColorHi()); } + @Override + public Object clone() throws CloneNotSupportedException { + ModernCartDesign clone = (ModernCartDesign) super.clone(); + clone.backgroundColor = backgroundColor; + clone.playColor = playColor; + return clone; + } + } diff --git a/PlayWall/src/de/tobias/playpad/design/modern/ModernGlobalDesign.java b/PlayWall/src/de/tobias/playpad/design/modern/ModernGlobalDesign.java index 28da223a3b6150adb173a1ce7d6e81c76450f36a..37ff76e8f621881c49b2d9f28bc06f412ac83e2c 100644 --- a/PlayWall/src/de/tobias/playpad/design/modern/ModernGlobalDesign.java +++ b/PlayWall/src/de/tobias/playpad/design/modern/ModernGlobalDesign.java @@ -21,7 +21,6 @@ import de.tobias.playpad.pad.conntent.play.Durationable; import de.tobias.playpad.pad.viewcontroller.IPadViewController; import de.tobias.playpad.project.Project; import de.tobias.playpad.settings.Profile; -import de.tobias.playpad.settings.Warning; import de.tobias.playpad.view.ColorPickerView; import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.utils.application.ApplicationUtils; @@ -280,7 +279,7 @@ public class ModernGlobalDesign extends Design implements GlobalDesign, DesignCo // Warn Handler -> Animation oder Blinken @Override - public void handleWarning(IPadViewController controller, Warning warning) { + public void handleWarning(IPadViewController controller, Duration warning) { if (isWarnAnimation) { warnAnimation(controller, warning); } else { @@ -293,20 +292,19 @@ public class ModernGlobalDesign extends Design implements GlobalDesign, DesignCo ModernDesignAnimator.stopAnimation(controller); } - private void warnAnimation(IPadViewController controller, Warning warning) { + private void warnAnimation(IPadViewController controller, Duration warning) { FadeableColor stopColor = new FadeableColor(this.backgroundColor.getColorHi(), this.backgroundColor.getColorLow()); FadeableColor playColor = new FadeableColor(this.playColor.getColorHi(), this.playColor.getColorLow()); - Duration warnDuration = warning.getTime(); Pad pad = controller.getPad(); if (pad.getContent() instanceof Durationable) { - if (warnDuration.greaterThan(((Durationable) pad.getContent()).getDuration())) { - warnDuration = ((Durationable) pad.getContent()).getDuration(); + if (warning.greaterThan(((Durationable) pad.getContent()).getDuration())) { + warning = ((Durationable) pad.getContent()).getDuration(); } } - ModernDesignAnimator.animateWarn(controller, playColor, stopColor, warnDuration); + ModernDesignAnimator.animateWarn(controller, playColor, stopColor, warning); } // Color Associator diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadDragListener.java b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadDragListener.java index 18169687bfb0e6df89c1401a52eb65c88dd0307b..5d5ef535dc72721464a7cc66853ae51c8cfbfd69 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadDragListener.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadDragListener.java @@ -9,9 +9,9 @@ import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.layout.desktop.DesktopEditMode; import de.tobias.playpad.layout.desktop.DesktopMainLayoutConnect; import de.tobias.playpad.pad.Pad; -import de.tobias.playpad.pad.PadContentRegistry; import de.tobias.playpad.pad.conntent.PadContent; import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.drag.PadDragMode; import de.tobias.playpad.pad.view.IPadView; import de.tobias.playpad.project.Project; diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java index 4512069665c2458ad114726081f475473827e80e..567d497b129d854acc27d35780b9ba17446eeabd 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java @@ -4,9 +4,9 @@ import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.PseudoClasses; import de.tobias.playpad.layout.desktop.DesktopMainLayoutConnect; import de.tobias.playpad.pad.Pad; -import de.tobias.playpad.pad.PadContentRegistry; import de.tobias.playpad.pad.conntent.PadContent; import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.conntent.play.Pauseable; import de.tobias.playpad.pad.view.IPadContentView; import de.tobias.playpad.pad.view.IPadView; diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadViewController.java b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadViewController.java index 581856e489b60ae6b02de541129d64abb851ac0f..b252d13b36915e32bbb9e4709bdf38fc69e777ce 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadViewController.java @@ -10,11 +10,11 @@ import de.tobias.playpad.Strings; import de.tobias.playpad.layout.desktop.DesktopEditMode; import de.tobias.playpad.layout.desktop.DesktopMainLayoutConnect; import de.tobias.playpad.pad.Pad; -import de.tobias.playpad.pad.PadContentRegistry; import de.tobias.playpad.pad.PadStatus; import de.tobias.playpad.pad.TimeMode; import de.tobias.playpad.pad.conntent.PadContent; import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.conntent.play.Durationable; import de.tobias.playpad.pad.listener.IPadPositionListener; import de.tobias.playpad.pad.listener.PadContentListener; diff --git a/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java b/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java index b34fd90868d42fee4186e065b8aeac89f6804d2e..5a0dc867328d956868ea95a2ed51b2dd0c5664a0 100644 --- a/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java +++ b/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java @@ -258,4 +258,11 @@ public class AudioContent extends PadContent implements Pauseable, Durationable, } } + @Override + public PadContent clone() throws CloneNotSupportedException { + AudioContent clone = (AudioContent) super.clone(); + clone.path = Paths.get(path.toUri()); + clone.loadMedia(); + return clone; + } } diff --git a/PlayWall/src/de/tobias/playpad/pad/drag/DuplicateDragMode.java b/PlayWall/src/de/tobias/playpad/pad/drag/DuplicateDragMode.java new file mode 100644 index 0000000000000000000000000000000000000000..c1101315aa0e6d187444a8fe6923f5aeb0887b55 --- /dev/null +++ b/PlayWall/src/de/tobias/playpad/pad/drag/DuplicateDragMode.java @@ -0,0 +1,60 @@ +package de.tobias.playpad.pad.drag; + +import de.tobias.playpad.Strings; +import de.tobias.playpad.pad.Pad; +import de.tobias.playpad.project.Project; +import de.tobias.playpad.project.page.PadIndex; +import de.tobias.utils.ui.icon.FontAwesomeType; +import de.tobias.utils.ui.icon.FontIcon; +import de.tobias.utils.util.Localization; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; +import javafx.scene.Node; + +public class DuplicateDragMode extends PadDragMode { + + private static final String TYPE = "duplicate"; + + private FontIcon icon; + private StringProperty displayProperty; + + public DuplicateDragMode() { + icon = new FontIcon(FontAwesomeType.COPY); + icon.setSize(30); + + displayProperty = new SimpleStringProperty(Localization.getString(Strings.DnDMode_Duplicate)); + } + + @Override + public StringProperty displayProperty() { + return displayProperty; + } + + @Override + public Node getGraphics() { + return icon; + } + + @Override + public String getType() { + return TYPE; + } + + @Override + public boolean handle(PadIndex oldIndex, PadIndex newIndex, Project project) { + Pad oldPad = project.getPad(oldIndex); + try { + Pad copyPad = oldPad.clone(); + + // Alte Pads entfernen, damit keine Nebenabhängigkeiten entstehen in den verschiedenen Seiten + project.setPad(newIndex, null); + + // Neue Pads in die Seiten einfügen + project.setPad(newIndex, copyPad); + return true; + } catch (CloneNotSupportedException e) { + e.printStackTrace(); + } + return false; + } +} \ No newline at end of file diff --git a/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java b/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java index e1438baff5ac2aba882efa7c3dce463862b593a6..0bc0126ec95f77ab1cff8dd8c2800574ad1a3e59 100644 --- a/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java +++ b/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java @@ -8,7 +8,6 @@ import de.tobias.playpad.pad.conntent.play.Durationable; import de.tobias.playpad.pad.conntent.play.Fadeable; import de.tobias.playpad.pad.viewcontroller.IPadViewController; import de.tobias.playpad.settings.Profile; -import de.tobias.playpad.settings.Warning; import javafx.beans.value.ObservableValue; import javafx.util.Duration; @@ -66,11 +65,11 @@ public class PadPositionListener implements Runnable, IPadPositionListener { // wird if (!pad.getPadSettings().isLoop() && pad.getStatus() == PadStatus.PLAY) { // Warning - Warning warning = pad.getPadSettings().getWarning(); + Duration warning = pad.getPadSettings().getWarning(); Duration rest = durationable.getDuration().subtract(newValue); double seconds = rest.toSeconds(); - if (warning.getTime().toSeconds() > seconds && !send) { + if (warning.toSeconds() > seconds && !send) { startWarningThread(); send = true; } @@ -88,7 +87,7 @@ public class PadPositionListener implements Runnable, IPadPositionListener { @Override public void run() { PadSettings padSettings = pad.getPadSettings(); - Warning warning = padSettings.getWarning(); + Duration warning = padSettings.getWarning(); if (padSettings.isCustomLayout()) { padSettings.getDesign().handleWarning(controller, warning, Profile.currentProfile().currentLayout()); diff --git a/PlayWall/src/de/tobias/playpad/view/PadDragOptionView.java b/PlayWall/src/de/tobias/playpad/view/PadDragOptionView.java index 16a64687ce031eac36fb3ccd1d14adc61cf7488e..5f2fd9cbd8c94bc862402cb6da22f17a40eb9057 100644 --- a/PlayWall/src/de/tobias/playpad/view/PadDragOptionView.java +++ b/PlayWall/src/de/tobias/playpad/view/PadDragOptionView.java @@ -109,7 +109,12 @@ public class PadDragOptionView { for (PadDragMode connect : options.stream().sorted().toArray(value -> new PadDragMode[value])) { Label label = new Label(); label.getStyleClass().add("dnd-file-option"); - label.textProperty().bind(connect.displayProperty()); + + // Text nur wenn 2 oder weniger Optionen sind, weil zu wenig Platz + if (options.size() >= 2) { + label.textProperty().bind(connect.displayProperty()); + } + Node graphics = connect.getGraphics(); if (graphics != null) { graphics.setStyle("-fx-text-fill: white;"); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/ErrorCell.java b/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/ErrorCell.java index 327b149134af2e172eb5849fcc9f4c0b32bbf72f..adc09ae77eb350f40b0e9226abf9be3ccc9dde0d 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/ErrorCell.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/ErrorCell.java @@ -1,7 +1,6 @@ package de.tobias.playpad.viewcontroller.cell.errordialog; import de.tobias.playpad.pad.PadException; -import javafx.scene.control.Control; import javafx.scene.control.TableCell; import javafx.scene.layout.Region; import javafx.scene.text.Text; diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/IOExceptionButtonListener.java b/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/IOExceptionButtonListener.java index 94b61fe98861c4299b201c66436513213f2f1f4d..d0ff923ecac5c67c074a2a808096107638549d0d 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/IOExceptionButtonListener.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/IOExceptionButtonListener.java @@ -6,10 +6,10 @@ import java.nio.file.Path; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.pad.Pad; -import de.tobias.playpad.pad.PadContentRegistry; import de.tobias.playpad.pad.PadException; import de.tobias.playpad.pad.conntent.PadContent; import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.view.ExceptionButton; import de.tobias.utils.util.FileUtils; diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java index 468c689d0beae454669725b3c0e072e37c87c4a1..111ad6285b739667f3ffb71d3013f3c03c34b50e 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java @@ -8,10 +8,10 @@ import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.Strings; import de.tobias.playpad.pad.Pad; -import de.tobias.playpad.pad.PadContentRegistry; import de.tobias.playpad.pad.PadStatus; import de.tobias.playpad.pad.conntent.PadContent; import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.conntent.path.MultiPathContent; import de.tobias.playpad.pad.conntent.path.SinglePathContent; import de.tobias.playpad.registry.NoSuchComponentException; diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PlayerPadTabViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PlayerPadTabViewController.java index 8757543768ae05b1b536979e26c6cdc1d0960322..3bb69488e0b907a031b3c9643884a89e51f2daba 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PlayerPadTabViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PlayerPadTabViewController.java @@ -5,7 +5,6 @@ import de.tobias.playpad.Strings; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.PadSettings; import de.tobias.playpad.settings.Fade; -import de.tobias.playpad.settings.Warning; import de.tobias.playpad.viewcontroller.PadSettingsTabViewController; import de.tobias.playpad.viewcontroller.settings.FadeViewController; import de.tobias.playpad.viewcontroller.settings.WarningFeedbackViewController; @@ -13,6 +12,7 @@ import de.tobias.utils.util.Localization; import javafx.fxml.FXML; import javafx.scene.control.CheckBox; import javafx.scene.layout.VBox; +import javafx.util.Duration; public class PlayerPadTabViewController extends PadSettingsTabViewController { @@ -60,7 +60,7 @@ public class PlayerPadTabViewController extends PadSettingsTabViewController { PadSettings padSettings = pad.getPadSettings(); if (c && !padSettings.isCustomWarning()) - padSettings.setWarning(new Warning()); + padSettings.setWarning(Duration.seconds(5)); else if (!c && padSettings.isCustomWarning()) padSettings.setWarning(null); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/settings/WarningFeedbackViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/settings/WarningFeedbackViewController.java index ff0bb390135736ffb001579e52180aa04c562ab8..f2dca4d82a593bf8c1813d691b1a968d8d06faed 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/settings/WarningFeedbackViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/settings/WarningFeedbackViewController.java @@ -21,12 +21,12 @@ public class WarningFeedbackViewController extends ContentViewController { super("warningFeedbackSettingsView", "de/tobias/playpad/assets/settings/", PlayPadMain.getUiResourceBundle()); ProfileSettings profilSettings = Profile.currentProfile().getProfileSettings(); - warningFeedbackTimeSlider.setValue(profilSettings.getWarningFeedback().getTime().toSeconds()); + warningFeedbackTimeSlider.setValue(profilSettings.getWarningFeedback().toSeconds()); setTimeLabel(); warningFeedbackTimeSlider.valueProperty().addListener((a, b, c) -> { - profilSettings.getWarningFeedback().setTime(Duration.seconds(c.doubleValue())); + profilSettings.setWarningTime(Duration.seconds(c.doubleValue())); }); } @@ -49,13 +49,13 @@ public class WarningFeedbackViewController extends ContentViewController { public void setPadWarning(Pad pad) { if (pad.getPadSettings().getWarning() != null) { - warningFeedbackTimeSlider.setValue(pad.getPadSettings().getWarning().getTime().toSeconds()); + warningFeedbackTimeSlider.setValue(pad.getPadSettings().getWarning().toSeconds()); setTimeLabel(); } warningFeedbackTimeSlider.valueProperty().addListener((a, b, c) -> { - pad.getPadSettings().getWarning().setTime(Duration.seconds(c.doubleValue())); + pad.getPadSettings().setWarning(Duration.seconds(c.doubleValue())); }); } } diff --git a/PlayWallCore/src/de/tobias/playpad/RegistryCollection.java b/PlayWallCore/src/de/tobias/playpad/RegistryCollection.java index c13e9df65df0fb3af5e87eb45c06d1a3b127ebbb..86f1372ca0fc0bb4aa47aaf6612b478fd68b99b4 100644 --- a/PlayWallCore/src/de/tobias/playpad/RegistryCollection.java +++ b/PlayWallCore/src/de/tobias/playpad/RegistryCollection.java @@ -4,7 +4,7 @@ import de.tobias.playpad.action.ActionConnect; import de.tobias.playpad.action.mapper.MapperConnect; import de.tobias.playpad.audio.AudioRegistry; import de.tobias.playpad.design.DesignConnect; -import de.tobias.playpad.pad.PadContentRegistry; +import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.drag.PadDragMode; import de.tobias.playpad.registry.DefaultRegistry; import de.tobias.playpad.registry.Registry; diff --git a/PlayWallCore/src/de/tobias/playpad/design/CartDesign.java b/PlayWallCore/src/de/tobias/playpad/design/CartDesign.java index 12d6f3a81c062d1bfc85fa226e8800cd59306396..bdb096a5ffab05ad5354be081cc3cef810301855 100644 --- a/PlayWallCore/src/de/tobias/playpad/design/CartDesign.java +++ b/PlayWallCore/src/de/tobias/playpad/design/CartDesign.java @@ -3,7 +3,7 @@ package de.tobias.playpad.design; import org.dom4j.Element; import de.tobias.playpad.pad.viewcontroller.IPadViewController; -import de.tobias.playpad.settings.Warning; +import javafx.util.Duration; public interface CartDesign { @@ -22,11 +22,13 @@ public interface CartDesign { /* * Wird in einem neuen Thread aufgerufen */ - public abstract void handleWarning(IPadViewController controller, Warning warning, GlobalDesign animate); + public abstract void handleWarning(IPadViewController controller, Duration warning, GlobalDesign animate); public default void stopWarning(IPadViewController controller) {} public void reset(); public void copyGlobalLayout(GlobalDesign globalLayout); + + Object clone() throws CloneNotSupportedException; } diff --git a/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java b/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java index de0fe92c4eed206e06e9191ff8feb511f58a134e..b8795f49297e3f8982e74edb0509e821366b44cd 100644 --- a/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java +++ b/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java @@ -19,9 +19,9 @@ import de.tobias.playpad.pad.viewcontroller.IPadViewController; import de.tobias.playpad.project.Project; import de.tobias.playpad.registry.DefaultRegistry; import de.tobias.playpad.registry.NoSuchComponentException; -import de.tobias.playpad.settings.Warning; import de.tobias.playpad.viewcontroller.main.IMainViewController; import javafx.stage.Stage; +import javafx.util.Duration; public interface GlobalDesign { @@ -50,7 +50,7 @@ public interface GlobalDesign { /* * Wird in einem neuen Thread aufgerufen */ - public void handleWarning(IPadViewController controller, Warning warning); + public void handleWarning(IPadViewController controller, Duration warning); public default void stopWarning(IPadViewController controller) {} diff --git a/PlayWallCore/src/de/tobias/playpad/pad/Pad.java b/PlayWallCore/src/de/tobias/playpad/pad/Pad.java index 1707bb189b290398ed55985aac0742c387c694dd..4a3ea2f3d6b6c07adeee17a67f966310450ca513 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/Pad.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/Pad.java @@ -21,7 +21,7 @@ import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; -public class Pad { +public class Pad implements Cloneable { private static final VolumeManager volumeManager; @@ -90,6 +90,19 @@ public class Pad { } private void initPadListener() { + // Remov eold listener from propeties + if (padStatusListener != null && statusProperty != null) { + statusProperty.removeListener(padStatusListener); + } + if (padTriggerStatusListener != null && statusProperty != null) { + statusProperty.removeListener(padTriggerStatusListener); + } + if (padTriggerDurationListener != null && contentProperty != null) { + contentProperty.removeListener(padTriggerContentListener); + padTriggerContentListener.changed(contentProperty, getContent(), null); + } + + // init new listener for properties padStatusListener = new PadStatusListener(this); statusProperty.addListener(padStatusListener); @@ -284,4 +297,24 @@ public class Pad { public static VolumeManager getVolumeManager() { return volumeManager; } + + // Clone + @Override + public Pad clone() throws CloneNotSupportedException { + Pad clone = (Pad) super.clone(); + + clone.uuid = UUID.randomUUID(); + clone.indexProperty = new SimpleIntegerProperty(); + clone.pageProperty = new SimpleIntegerProperty(); + + clone.nameProperty = new SimpleStringProperty(getName()); + clone.statusProperty = new SimpleObjectProperty<PadStatus>(getStatus()); + clone.contentProperty = new SimpleObjectProperty<PadContent>(getContent().clone()); + clone.getContent().setPad(clone); + + clone.padSettings = padSettings.clone(); + + clone.initPadListener(); + return clone; + } } diff --git a/PlayWallCore/src/de/tobias/playpad/pad/PadSerializer.java b/PlayWallCore/src/de/tobias/playpad/pad/PadSerializer.java index b623ca151241ecef1191577afd2aec20aad0b0b3..e932e8d641e7547ef7b9c54c3fd250545d94d514 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/PadSerializer.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/PadSerializer.java @@ -15,12 +15,12 @@ import de.tobias.playpad.registry.DefaultRegistry; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.registry.Registry; import de.tobias.playpad.settings.Fade; -import de.tobias.playpad.settings.Warning; import de.tobias.playpad.tigger.Trigger; import de.tobias.playpad.tigger.TriggerPoint; import de.tobias.utils.settings.UserDefaults; import de.tobias.utils.xml.XMLDeserializer; import de.tobias.utils.xml.XMLSerializer; +import javafx.util.Duration; public class PadSerializer implements XMLSerializer<Pad>, XMLDeserializer<Pad> { @@ -78,8 +78,14 @@ public class PadSerializer implements XMLSerializer<Pad>, XMLDeserializer<Pad> { padSettings.setTimeMode(TimeMode.valueOf(settingsElement.element(TIMEMODE_ELEMENT).getStringValue())); if (settingsElement.element(FADE_ELEMENT) != null) padSettings.setFade(Fade.load(settingsElement.element(FADE_ELEMENT))); - if (settingsElement.element(WARNING_ELEMENT) != null) - padSettings.setWarning(Warning.load(settingsElement.element(WARNING_ELEMENT))); + if (settingsElement.element(WARNING_ELEMENT) != null) { + try { + Duration duration = Duration.valueOf(settingsElement.element(WARNING_ELEMENT).getStringValue().replace(" ", "")); + padSettings.setWarning(duration); + } catch (Exception e) { + padSettings.setWarning(Duration.seconds(5)); + } + } // Laoyut Element layoutsElement = settingsElement.element(LAYOUTS_ELEMENT); @@ -173,7 +179,7 @@ public class PadSerializer implements XMLSerializer<Pad>, XMLDeserializer<Pad> { if (padSettings.isCustomTimeMode()) settingsElement.addElement(TIMEMODE_ELEMENT).addText(String.valueOf(padSettings.getTimeMode())); if (padSettings.isCustomWarning()) - padSettings.getWarning().save(settingsElement.addElement(WARNING_ELEMENT)); + settingsElement.addElement(WARNING_ELEMENT).addText(padSettings.getWarning().toString()); if (padSettings.isCustomFade()) padSettings.getFade().save(settingsElement.addElement(FADE_ELEMENT)); diff --git a/PlayWallCore/src/de/tobias/playpad/pad/PadSettings.java b/PlayWallCore/src/de/tobias/playpad/pad/PadSettings.java index f0fd7b3d1d40c0d058b962947798fff75ba29750..4a20423b43a985be42507d896bf017dbcf044385 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/PadSettings.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/PadSettings.java @@ -9,7 +9,6 @@ import de.tobias.playpad.registry.DefaultRegistry; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Fade; import de.tobias.playpad.settings.Profile; -import de.tobias.playpad.settings.Warning; import de.tobias.playpad.tigger.Trigger; import de.tobias.playpad.tigger.TriggerPoint; import javafx.beans.binding.BooleanBinding; @@ -19,15 +18,16 @@ import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleDoubleProperty; import javafx.beans.property.SimpleObjectProperty; +import javafx.util.Duration; -public class PadSettings { +public class PadSettings implements Cloneable { // Settings private DoubleProperty volumeProperty = new SimpleDoubleProperty(1.0); private BooleanProperty loopProperty = new SimpleBooleanProperty(false); private ObjectProperty<TimeMode> timeModeProperty = new SimpleObjectProperty<>(); private ObjectProperty<Fade> fadeProperty = new SimpleObjectProperty<>(); - private ObjectProperty<Warning> warningProperty = new SimpleObjectProperty<>(); + private ObjectProperty<Duration> warningProperty = new SimpleObjectProperty<>(); private BooleanProperty customLayoutProperty = new SimpleBooleanProperty(false); private HashMap<String, CartDesign> layouts = new HashMap<>(); @@ -123,7 +123,7 @@ public class PadSettings { return warningProperty.isNotNull(); } - public Warning getWarning() { + public Duration getWarning() { if (warningProperty.isNull().get()) { if (Profile.currentProfile() != null) { return Profile.currentProfile().getProfileSettings().getWarningFeedback(); @@ -132,11 +132,11 @@ public class PadSettings { return warningProperty.get(); } - public void setWarning(Warning warning) { + public void setWarning(Duration warning) { this.warningProperty.set(warning); } - public ObjectProperty<Warning> warningProperty() { + public ObjectProperty<Duration> warningProperty() { return warningProperty; } @@ -205,4 +205,25 @@ public class PadSettings { } return false; } + + @Override + public PadSettings clone() throws CloneNotSupportedException { + PadSettings settings = (PadSettings) super.clone(); + settings.volumeProperty = new SimpleDoubleProperty(getVolume()); + settings.loopProperty = new SimpleBooleanProperty(isLoop()); + settings.timeModeProperty = new SimpleObjectProperty<TimeMode>(getTimeMode()); + settings.warningProperty = new SimpleObjectProperty<>(getWarning()); + settings.layouts = new HashMap<>(); + for (String key : layouts.keySet()) { + CartDesign clone = (CartDesign) layouts.get(key).clone(); + settings.layouts.put(key, clone); + } + + settings.triggers = new HashMap<>(); // TODO Trigger werden nicht Kopiert + settings.customSettings = new HashMap<>(); // TODO CustomSettings werden nicht Kopiert + + settings.updateTrigger(); + + return settings; + } } diff --git a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContent.java b/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContent.java index d9b655cb38def31558466793b3286d570becf600..31687a55309837b4319b84bee51d3f2f2febe26f 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContent.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContent.java @@ -20,7 +20,7 @@ import de.tobias.utils.util.ZipFile; * @version 5.1.0 * @see Pad */ -public abstract class PadContent { +public abstract class PadContent implements Cloneable { // Refrence private Pad pad; @@ -33,6 +33,14 @@ public abstract class PadContent { return pad; } + /** + * Never use this. only for cloning + * @param pad + */ + public void setPad(Pad pad) { + this.pad = pad; + } + public abstract String getType(); public abstract void play(); @@ -115,4 +123,10 @@ public abstract class PadContent { return orginal; } + @Override + public PadContent clone() throws CloneNotSupportedException { + PadContent clone = (PadContent) super.clone(); + return clone; + } + } \ No newline at end of file diff --git a/PlayWallCore/src/de/tobias/playpad/pad/PadContentRegistry.java b/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java similarity index 93% rename from PlayWallCore/src/de/tobias/playpad/pad/PadContentRegistry.java rename to PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java index 522a30692b022e4586e91bacfac5b01556fcd980..d3e6374a17468d79875453f51c8c579c86ab00ad 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/PadContentRegistry.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java @@ -1,4 +1,4 @@ -package de.tobias.playpad.pad; +package de.tobias.playpad.pad.conntent; import java.nio.file.Path; import java.util.ArrayList; @@ -7,7 +7,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import de.tobias.playpad.pad.conntent.PadContentConnect; import de.tobias.playpad.registry.ComponentRegistry; import de.tobias.playpad.registry.NoSuchComponentException; diff --git a/PlayWallCore/src/de/tobias/playpad/settings/ProfileSettings.java b/PlayWallCore/src/de/tobias/playpad/settings/ProfileSettings.java index 0c3e79c73f2dfd192423ee37cc4f9993ed28b021..2bddc8675cdfef0c1910b0804f37cf7be74bfcb9 100644 --- a/PlayWallCore/src/de/tobias/playpad/settings/ProfileSettings.java +++ b/PlayWallCore/src/de/tobias/playpad/settings/ProfileSettings.java @@ -46,7 +46,7 @@ public class ProfileSettings implements SettingsSerializable { // Cart Settings @Storable private boolean multiplePlayer = true; - @Storable private Warning warningFeedback = new Warning(Duration.seconds(5)); + @Storable private Duration warningTime = Duration.seconds(5); @Storable private DoubleProperty volumeProperty = new SimpleDoubleProperty(1.0); @@ -80,8 +80,8 @@ public class ProfileSettings implements SettingsSerializable { return mainLayoutType; } - public Warning getWarningFeedback() { - return warningFeedback; + public Duration getWarningFeedback() { + return warningTime; } public boolean isMidiActive() { @@ -129,8 +129,8 @@ public class ProfileSettings implements SettingsSerializable { this.mainLayoutType = mainLayoutType; } - public void setWarningFeedback(Warning warningFeedback) { - this.warningFeedback = warningFeedback; + public void setWarningTime(Duration warningTime) { + this.warningTime = warningTime; } public void setMidiActive(boolean midiActive) { @@ -210,9 +210,11 @@ public class ProfileSettings implements SettingsSerializable { } if (root.element(WARNING_ELEMENT) != null) { - Warning warning = Warning.load(root.element(WARNING_ELEMENT)); - if (warning != null) { - profileSettings.setWarningFeedback(warning); + try { + Duration duration = Duration.valueOf(root.element(WARNING_ELEMENT).getStringValue().replace(" ", "")); + profileSettings.setWarningTime(duration); + } catch (Exception e) { + profileSettings.setWarningTime(Duration.seconds(5)); } } @@ -266,7 +268,7 @@ public class ProfileSettings implements SettingsSerializable { root.addElement(LAYOUT_TYPE_ELEMENT).addText(layoutType); root.addElement(MAIN_LAYOUT_TYPE_ELEMENT).addText(mainLayoutType); - warningFeedback.save(root.addElement(WARNING_ELEMENT)); + root.addElement(WARNING_ELEMENT).addText(warningTime.toString()); fade.save(root.addElement(FADE_ELEMENT)); root.addElement(TIME_DISPLAY_ELEMENT).addText(player_timeDisplayMode.name()); diff --git a/PlayWallCore/src/de/tobias/playpad/settings/Warning.java b/PlayWallCore/src/de/tobias/playpad/settings/Warning.java index 56de8f3d2bdbb892aff6966cd72384500d339cb5..edb1944b0f630b1b7b6535eb4d235844714e5f39 100644 --- a/PlayWallCore/src/de/tobias/playpad/settings/Warning.java +++ b/PlayWallCore/src/de/tobias/playpad/settings/Warning.java @@ -6,10 +6,11 @@ import de.tobias.utils.settings.SettingsSerializable; import de.tobias.utils.settings.Storable; import javafx.util.Duration; -public class Warning implements SettingsSerializable{ +@Deprecated +public class Warning implements SettingsSerializable { private static final long serialVersionUID = 1L; - + @Storable private Duration time; public Warning() { diff --git a/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/image/ImageContent.java b/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/image/ImageContent.java index 60a7195c4f219ebafff26e8c7b0c61ecf300f0b2..1856b369ac7080c9be4548540b83ef07b5f5ec7e 100644 --- a/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/image/ImageContent.java +++ b/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/image/ImageContent.java @@ -130,5 +130,13 @@ public class ImageContent extends PadContent { e.printStackTrace(); } } + + @Override + public PadContent clone() throws CloneNotSupportedException { + ImageContent clone = (ImageContent) super.clone(); + clone.path = Paths.get(path.toUri()); + clone.loadMedia(); + return clone; + } } \ No newline at end of file diff --git a/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/video/VideoContent.java b/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/video/VideoContent.java index 6b622b5ad39953513b37d8488534a3fd2b342a0d..a113ea1b56cfab56d627ca3c3d59147f1e3be365 100644 --- a/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/video/VideoContent.java +++ b/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/video/VideoContent.java @@ -269,4 +269,12 @@ public class VideoContent extends PadContent implements Pauseable, Durationable e.printStackTrace(); } } + + @Override + public PadContent clone() throws CloneNotSupportedException { + VideoContent clone = (VideoContent) super.clone(); + clone.path = Paths.get(path.toUri()); + clone.loadMedia(); + return clone; + } } \ No newline at end of file