From cb59ffc2ecdb55701f8297a2517d23c8eadd56a4 Mon Sep 17 00:00:00 2001 From: tobias <tobias.ullerich@icloud.com> Date: Thu, 4 Aug 2016 21:39:50 +0200 Subject: [PATCH] Continue on touchmode code cleanup remove old registries --- PlayWall/.classpath | 2 +- .../de/tobias/playpad/assets/style/touch.css | 2 +- .../src/de/tobias/playpad/PlayPadMain.java | 30 ---- .../layout/desktop/DesktopPadView.java | 6 +- .../desktop/DesktopPadViewController.java | 90 +++++++++++- .../touch/TouchMenuToolbarViewController.java | 2 +- .../playpad/layout/touch/TouchPadView.java | 8 +- .../layout/touch/TouchPadViewController.java | 135 ++++++++++++++---- .../pad/listener/PadPositionListener.java | 2 +- .../playpad/view/touch/PadViewTouch.java | 95 ------------ .../main/MainViewControllerV2.java | 6 + .../option/pad/PadSettingsViewController.java | 1 + .../viewcontroller/pad/PadViewController.java | 108 +++++++------- .../playpad/action/ActionRegistery.java | 30 ---- .../tobias/playpad/design/LayoutRegistry.java | 40 ------ .../pad/conntent/PadContentRegistry.java | 72 ---------- .../conntent/UnkownPadContentException.java | 12 -- .../tobias/playpad/pad/view/IPadViewV2.java | 11 +- .../de/tobias/playpad/settings/Profile.java | 17 ++- .../src/de/tobias/playpad/tigger/Trigger.java | 18 ++- .../playpad/tigger/TriggerRegistry.java | 25 ---- .../main/IMainViewController.java | 7 +- .../actionsplugin/impl/ActionsPluginImpl.java | 21 +-- .../main/impl/MediaPluginImpl.java | 11 +- 24 files changed, 310 insertions(+), 441 deletions(-) delete mode 100644 PlayWall/src/de/tobias/playpad/view/touch/PadViewTouch.java delete mode 100644 PlayWallCore/src/de/tobias/playpad/action/ActionRegistery.java delete mode 100644 PlayWallCore/src/de/tobias/playpad/design/LayoutRegistry.java delete mode 100644 PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java delete mode 100644 PlayWallCore/src/de/tobias/playpad/pad/conntent/UnkownPadContentException.java delete mode 100644 PlayWallCore/src/de/tobias/playpad/tigger/TriggerRegistry.java diff --git a/PlayWall/.classpath b/PlayWall/.classpath index 0ede5a86..d6c36775 100644 --- a/PlayWall/.classpath +++ b/PlayWall/.classpath @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry excluding="**/.DS_Store|**/.gitignore|icon.icns|icon.ico" kind="src" path="src"/> + <classpathentry excluding="**/.DS_Store|**/.gitignore|icon.icns|icon.ico|de/tobias/playpad/viewcontroller/main/MainMenuBarController.java|de/tobias/playpad/viewcontroller/main/MainToolbarController.java|de/tobias/playpad/viewcontroller/main/MainViewController.java|de/tobias/playpad/viewcontroller/pad/PadViewController.java|de/tobias/playpad/view/PadView.java" kind="src" path="src"/> <classpathentry excluding="**/.gitignor|de/tobias/playpad/assets/files/dialogDnD.pxm" kind="src" path="assets"/> <classpathentry kind="src" path="test"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> diff --git a/PlayWall/assets/de/tobias/playpad/assets/style/touch.css b/PlayWall/assets/de/tobias/playpad/assets/style/touch.css index 8ae65926..4db18b4f 100644 --- a/PlayWall/assets/de/tobias/playpad/assets/style/touch.css +++ b/PlayWall/assets/de/tobias/playpad/assets/style/touch.css @@ -4,7 +4,7 @@ } .label { - -fx-font-size: 17px; + -fx-font-size: 20px; } .button { diff --git a/PlayWall/src/de/tobias/playpad/PlayPadMain.java b/PlayWall/src/de/tobias/playpad/PlayPadMain.java index 3efcb2c0..26fd6ff5 100644 --- a/PlayWall/src/de/tobias/playpad/PlayPadMain.java +++ b/PlayWall/src/de/tobias/playpad/PlayPadMain.java @@ -11,34 +11,21 @@ import java.util.UUID; import org.dom4j.DocumentException; -import de.tobias.playpad.action.ActionRegistery; -import de.tobias.playpad.action.connect.CartActionConnect; -import de.tobias.playpad.action.connect.NavigateActionConnect; -import de.tobias.playpad.action.connect.PageActionConnect; import de.tobias.playpad.action.mapper.KeyboardMapperConnect; import de.tobias.playpad.action.mapper.MapperRegistry; import de.tobias.playpad.action.mapper.MidiMapperConnect; import de.tobias.playpad.audio.ClipAudioHandler; import de.tobias.playpad.audio.JavaFXAudioHandler; import de.tobias.playpad.audio.TinyAudioHandler; -import de.tobias.playpad.design.LayoutRegistry; -import de.tobias.playpad.design.classic.ClassicDesignConnect; -import de.tobias.playpad.design.classic.ClassicGlobalDesign; -import de.tobias.playpad.design.modern.ModernDesignConnect; import de.tobias.playpad.design.modern.ModernGlobalDesign; import de.tobias.playpad.midi.device.DeviceRegistry; import de.tobias.playpad.midi.device.PD12; -import de.tobias.playpad.pad.conntent.PadContentRegistry; -import de.tobias.playpad.pad.content.AudioContentConnect; import de.tobias.playpad.project.Project; import de.tobias.playpad.project.ProjectReference; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.settings.ProfileListener; import de.tobias.playpad.settings.ProfileReference; -import de.tobias.playpad.tigger.TriggerRegistry; -import de.tobias.playpad.trigger.CartTriggerItemConnect; -import de.tobias.playpad.trigger.VolumeTriggerItemConnect; import de.tobias.playpad.update.PlayPadUpdater; import de.tobias.playpad.update.UpdateRegistery; import de.tobias.playpad.update.Updates; @@ -207,31 +194,14 @@ public class PlayPadMain extends Application implements LocalizationDelegate, Pr } private void registerComponents() { - // Layout - LayoutRegistry.registerLayout(new ClassicDesignConnect()); - LayoutRegistry.registerLayout(new ModernDesignConnect()); - LayoutRegistry.setDefaultLayout(ClassicGlobalDesign.TYPE); - // Midi DeviceRegistry.getFactoryInstance().registerDevice(PD12.NAME, PD12.class); - // Trigger - TriggerRegistry.register(new CartTriggerItemConnect()); - TriggerRegistry.register(new VolumeTriggerItemConnect()); - - // Actions - ActionRegistery.registerActionConnect(new CartActionConnect()); - ActionRegistery.registerActionConnect(new PageActionConnect()); - ActionRegistery.registerActionConnect(new NavigateActionConnect()); - // Mapper MapperRegistry.registerMapperConnect(new MidiMapperConnect()); MapperRegistry.registerMapperConnect(new KeyboardMapperConnect()); MapperRegistry.setOverviewViewController(new MapperOverviewViewController()); - // Pad Content - PadContentRegistry.registerActionConnect(new AudioContentConnect()); - Profile.registerListener(this); try { diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java index 16ab7c5d..bb142d1a 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java @@ -181,7 +181,6 @@ public class DesktopPadView implements IPadViewV2 { this.playBar.setProgress(progress); } - @Override public ProgressBar getPlayBar() { return playBar; } @@ -374,4 +373,9 @@ public class DesktopPadView implements IPadViewV2 { public void setPlaybarVisible(boolean visible) { playBar.setVisible(visible); } + + @Override + public void setPlayBarProgress(double value) { + playBar.setProgress(value); + } } diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadViewController.java b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadViewController.java index 03fa9b1c..bfe72116 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadViewController.java @@ -1,9 +1,17 @@ package de.tobias.playpad.layout.desktop; +import java.io.File; +import java.nio.file.Path; +import java.util.Set; + 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.TimeMode; +import de.tobias.playpad.pad.conntent.PadContent; +import de.tobias.playpad.pad.conntent.PadContentConnect; import de.tobias.playpad.pad.conntent.play.Durationable; import de.tobias.playpad.pad.listener.IPadPositionListener; import de.tobias.playpad.pad.listener.PadContentListener; @@ -13,21 +21,29 @@ import de.tobias.playpad.pad.listener.PadPositionListener; import de.tobias.playpad.pad.listener.PadStatusListener; import de.tobias.playpad.pad.view.IPadViewV2; import de.tobias.playpad.pad.viewcontroller.IPadViewControllerV2; +import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.settings.ProfileSettings; +import de.tobias.playpad.view.FileDragOptionView; import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.playpad.viewcontroller.option.pad.PadSettingsViewController; import de.tobias.playpad.viewcontroller.pad.PadDragListener; +import de.tobias.utils.application.ApplicationUtils; +import de.tobias.utils.util.FileUtils; +import de.tobias.utils.util.Localization; import javafx.beans.value.ChangeListener; import javafx.event.ActionEvent; import javafx.event.EventHandler; +import javafx.scene.Node; +import javafx.stage.FileChooser; +import javafx.stage.FileChooser.ExtensionFilter; import javafx.stage.Stage; import javafx.util.Duration; public class DesktopPadViewController implements IPadViewControllerV2, EventHandler<ActionEvent> { protected static final String CURRENT_PAGE_BUTTON = "current-page-button"; - + private static final String OPEN_FOLDER = "openFolder"; private static final String DURATION_FORMAT = "%d:%02d"; private DesktopPadView padView; @@ -142,7 +158,12 @@ public class DesktopPadViewController implements IPadViewControllerV2, EventHand } else if (event.getSource() == padView.getStopButton()) { onStop(); } else if (event.getSource() == padView.getNewButton()) { - onNew(event); + try { + onNew(event); + } catch (NoSuchComponentException e) { + // TODO Error Handling + e.printStackTrace(); + } } else if (event.getSource() == padView.getSettingsButton()) { onSettings(); } @@ -166,8 +187,69 @@ public class DesktopPadViewController implements IPadViewControllerV2, EventHand } } - private void onNew(ActionEvent event) { - // TODO Implement + private void onNew(ActionEvent event) throws NoSuchComponentException { + ProfileSettings settings = Profile.currentProfile().getProfileSettings(); + if (pad.getProject() != null) { + if (settings.isLiveMode() && settings.isLiveModeFile() && pad.getProject().getPlayedPlayers() > 0) { + PlayPadPlugin.getImplementation().getMainViewController().showLiveInfo(); + return; + } + } + + FileChooser chooser = new FileChooser(); + PadContentRegistry registry = PlayPadPlugin.getRegistryCollection().getPadContents(); + + // File Extension + ExtensionFilter extensionFilter = new ExtensionFilter(Localization.getString(Strings.File_Filter_Media), + registry.getSupportedFileTypes()); + chooser.getExtensionFilters().add(extensionFilter); + + // Last Folder + Object openFolder = ApplicationUtils.getApplication().getUserDefaults().getData(OPEN_FOLDER); + if (openFolder != null) { + File folder = new File(openFolder.toString()); + chooser.setInitialDirectory(folder); + } + + File file = chooser.showOpenDialog(((Node) event.getTarget()).getScene().getWindow()); + if (file != null) { + Path path = file.toPath(); + + Set<PadContentConnect> connects = registry.getPadContentConnectsForFile(file.toPath()); + if (!connects.isEmpty()) { + if (connects.size() > 1) { + FileDragOptionView hud = new FileDragOptionView(padView.getRootNode()); + hud.showDropOptions(connects, connect -> + { + if (connect != null) { + setNewPadContent(file, path, connect); + hud.hide(); + } + }); + } else { + PadContentConnect connect = connects.iterator().next(); + setNewPadContent(file, path, connect); + } + } + + ApplicationUtils.getApplication().getUserDefaults().setData(OPEN_FOLDER, path.getParent().toString()); + } + } + + private void setNewPadContent(File file, Path path, PadContentConnect connect) { + PadContent content = pad.getContent(); + if (pad.getContent() == null || !pad.getContent().getType().equals(connect.getType())) { + content = connect.newInstance(pad); + this.pad.setContent(content); + } + + try { + content.handlePath(file.toPath()); + } catch (NoSuchComponentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + this.pad.setName(FileUtils.getFilenameWithoutExtention(path.getFileName())); } private void onSettings() { diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java index 17e1ff5b..b2519237 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java @@ -108,7 +108,7 @@ public class TouchMenuToolbarViewController extends BasicMenuToolbarViewControll @Override public Slider getVolumeSlider() { - return null; + return volumeSlider; } @Override diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java index 115adbcc..849b15cc 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java @@ -85,7 +85,7 @@ public class TouchPadView implements IPadViewV2 { root.getChildren().addAll(infoBox, preview, playBar); superRoot.getChildren().addAll(root); - + superRoot.setOnTouchPressed(controller); superRoot.setOnMouseClicked(controller); } @@ -155,7 +155,6 @@ public class TouchPadView implements IPadViewV2 { this.playBar.setProgress(progress); } - @Override public ProgressBar getPlayBar() { return playBar; } @@ -275,4 +274,9 @@ public class TouchPadView implements IPadViewV2 { public void setPlaybarVisible(boolean visible) { playBar.setVisible(visible); } + + @Override + public void setPlayBarProgress(double value) { + playBar.setProgress(value); + } } diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadViewController.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadViewController.java index 0eadc970..0a4c14f7 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadViewController.java @@ -1,9 +1,17 @@ package de.tobias.playpad.layout.touch; +import java.io.File; +import java.nio.file.Path; +import java.util.Set; + 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.TimeMode; +import de.tobias.playpad.pad.conntent.PadContent; +import de.tobias.playpad.pad.conntent.PadContentConnect; import de.tobias.playpad.pad.conntent.play.Durationable; import de.tobias.playpad.pad.listener.IPadPositionListener; import de.tobias.playpad.pad.listener.PadContentListener; @@ -13,25 +21,32 @@ import de.tobias.playpad.pad.listener.PadPositionListener; import de.tobias.playpad.pad.listener.PadStatusListener; import de.tobias.playpad.pad.view.IPadViewV2; import de.tobias.playpad.pad.viewcontroller.IPadViewControllerV2; +import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.settings.ProfileSettings; +import de.tobias.playpad.view.FileDragOptionView; import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.playpad.viewcontroller.option.pad.PadSettingsViewController; import de.tobias.playpad.viewcontroller.pad.PadDragListener; +import de.tobias.utils.application.ApplicationUtils; +import de.tobias.utils.util.FileUtils; +import de.tobias.utils.util.Localization; import javafx.beans.value.ChangeListener; -import javafx.event.ActionEvent; import javafx.event.Event; import javafx.event.EventHandler; +import javafx.scene.Node; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; import javafx.scene.input.TouchEvent; +import javafx.stage.FileChooser; +import javafx.stage.FileChooser.ExtensionFilter; import javafx.stage.Stage; import javafx.util.Duration; public class TouchPadViewController implements IPadViewControllerV2, EventHandler<Event> { protected static final String CURRENT_PAGE_BUTTON = "current-page-button"; - + private static final String OPEN_FOLDER = "openFolder"; private static final String DURATION_FORMAT = "%d:%02d"; private TouchPadView padView; @@ -142,42 +157,51 @@ public class TouchPadViewController implements IPadViewControllerV2, EventHandle if (event instanceof TouchEvent) { TouchEvent touchEvent = (TouchEvent) event; if (event.getEventType() == TouchEvent.TOUCH_PRESSED) { - if (touchEvent.getTouchCount() == 1) { - if (pad.getStatus() == PadStatus.PLAY) { - onStop(); - } else { - onPlay(); - } - } else if (touchEvent.getTouchCount() == 2) { - onSettings(); + if (touchEvent.getTouchCount() == 1 || touchEvent.getTouchCount() == 2) { + handleAction(touchEvent.getTouchCount() == 1, event); } } } else if (event instanceof MouseEvent) { if (event.getEventType() == MouseEvent.MOUSE_CLICKED) { MouseEvent mouseEvent = (MouseEvent) event; - if (mouseEvent.getButton() == MouseButton.PRIMARY) { - if (pad.getStatus() == PadStatus.PLAY) { - onStop(); - } else { - onPlay(); - } - } else if (mouseEvent.getButton() == MouseButton.SECONDARY) { - onSettings(); + if (mouseEvent.getButton() == MouseButton.PRIMARY || mouseEvent.getButton() == MouseButton.SECONDARY) { + handleAction(mouseEvent.getButton() == MouseButton.PRIMARY, event); } } } } - private void onPlay() { - if (pad.getContent() != null) { - pad.setStatus(PadStatus.PLAY); + /** + * Diese Methode handlet die Eingabe für Touch oder Mouse + * + * @param primaryAction + * <code>true</code> Touch einfacher Click, Mause Primary Button + * @param event + * event + */ + private void handleAction(boolean primaryAction, Event event) { + if (primaryAction) { + if (pad.getStatus() == PadStatus.EMPTY) { + try { + onNew(event); + } catch (NoSuchComponentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } else if (pad.getStatus() == PadStatus.PLAY) { + onStop(); + } else { + onPlay(); + } + } else { + onSettings(); } } - private void onPause() { + private void onPlay() { if (pad.getContent() != null) { - pad.setStatus(PadStatus.PAUSE); + pad.setStatus(PadStatus.PLAY); } } @@ -187,8 +211,69 @@ public class TouchPadViewController implements IPadViewControllerV2, EventHandle } } - private void onNew(ActionEvent event) { - // TODO Implement + private void onNew(Event event) throws NoSuchComponentException { + ProfileSettings settings = Profile.currentProfile().getProfileSettings(); + if (pad.getProject() != null) { + if (settings.isLiveMode() && settings.isLiveModeFile() && pad.getProject().getPlayedPlayers() > 0) { + PlayPadPlugin.getImplementation().getMainViewController().showLiveInfo(); + return; + } + } + + FileChooser chooser = new FileChooser(); + PadContentRegistry registry = PlayPadPlugin.getRegistryCollection().getPadContents(); + + // File Extension + ExtensionFilter extensionFilter = new ExtensionFilter(Localization.getString(Strings.File_Filter_Media), + registry.getSupportedFileTypes()); + chooser.getExtensionFilters().add(extensionFilter); + + // Last Folder + Object openFolder = ApplicationUtils.getApplication().getUserDefaults().getData(OPEN_FOLDER); + if (openFolder != null) { + File folder = new File(openFolder.toString()); + chooser.setInitialDirectory(folder); + } + + File file = chooser.showOpenDialog(((Node) event.getTarget()).getScene().getWindow()); + if (file != null) { + Path path = file.toPath(); + + Set<PadContentConnect> connects = registry.getPadContentConnectsForFile(file.toPath()); + if (!connects.isEmpty()) { + if (connects.size() > 1) { + FileDragOptionView hud = new FileDragOptionView(padView.getRootNode()); + hud.showDropOptions(connects, connect -> + { + if (connect != null) { + setNewPadContent(file, path, connect); + hud.hide(); + } + }); + } else { + PadContentConnect connect = connects.iterator().next(); + setNewPadContent(file, path, connect); + } + } + + ApplicationUtils.getApplication().getUserDefaults().setData(OPEN_FOLDER, path.getParent().toString()); + } + } + + private void setNewPadContent(File file, Path path, PadContentConnect connect) { + PadContent content = pad.getContent(); + if (pad.getContent() == null || !pad.getContent().getType().equals(connect.getType())) { + content = connect.newInstance(pad); + this.pad.setContent(content); + } + + try { + content.handlePath(file.toPath()); + } catch (NoSuchComponentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + this.pad.setName(FileUtils.getFilenameWithoutExtention(path.getFileName())); } private void onSettings() { diff --git a/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java b/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java index db5081c5..27b674a5 100644 --- a/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java +++ b/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java @@ -56,7 +56,7 @@ public class PadPositionListener implements Runnable, IPadPositionListener { private void updateDuration(Duration newValue, Durationable durationable, Duration totalDuration) { double value = newValue.toMillis() / totalDuration.toMillis(); - controller.getView().getPlayBar().setProgress(value); + controller.getView().setPlayBarProgress(value); // Label (Restlaufzeit) controller.updateTimeLabel(); diff --git a/PlayWall/src/de/tobias/playpad/view/touch/PadViewTouch.java b/PlayWall/src/de/tobias/playpad/view/touch/PadViewTouch.java deleted file mode 100644 index c4e3ba35..00000000 --- a/PlayWall/src/de/tobias/playpad/view/touch/PadViewTouch.java +++ /dev/null @@ -1,95 +0,0 @@ -package de.tobias.playpad.view.touch; - -import de.tobias.playpad.pad.Pad; -import de.tobias.playpad.pad.view.IPadContentView; -import de.tobias.playpad.viewcontroller.IPadView; -import de.tobias.playpad.viewcontroller.pad.PadViewController; -import de.tobias.utils.ui.scene.BusyView; -import javafx.css.PseudoClass; -import javafx.scene.Node; -import javafx.scene.control.Button; -import javafx.scene.control.ProgressBar; -import javafx.scene.layout.HBox; -import javafx.scene.layout.StackPane; - -public class PadViewTouch extends StackPane implements IPadView { - - private HBox preview; - private IPadContentView previewContent; - - private ProgressBar playBar; - - private BusyView busyView; - - private transient PadViewController controller; // Reference to its controller - - public PadViewTouch(PadViewController controller) { - this.controller = controller; - } - - @Override - public void setBusy(boolean busy) { - - } - - @Override - public void pseudoClassState(PseudoClass pseudoClass, boolean active) { - - } - - @Override - public Node getNewButton() { - return null; - } - - @Override - public Button getPlayButton() { - return null; - } - - @Override - public Button getPauseButton() { - return null; - } - - @Override - public Button getStopButton() { - return null; - } - - @Override - public ProgressBar getPlayBar() { - return null; - } - - @Override - public void showPlaybar(boolean b) { - - } - - @Override - public void setPreviewContent(Pad pad) { - - } - - @Override - public void addDefaultButton(Pad pad) { - - } - - @Override - public void setErrorLabelActive(boolean b) { - - } - - @Override - public void setTriggerLabelActive(boolean b) { - - } - - @Override - public IPadContentView getPadContentView() { - return null; - } - -} diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java index 745b5758..4dcf9be0 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java @@ -470,6 +470,12 @@ public class MainViewControllerV2 extends ViewController implements IMainViewCon } } + @Override + public void showLiveInfo() { + // TODO Auto-generated method stub + + } + // Settings @Override public void reloadSettings(Profile old, Profile currentProfile) { 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 466384b4..631696d9 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java @@ -186,5 +186,6 @@ public class PadSettingsViewController extends ViewController implements IPadSet for (PadSettingsTabViewController controller : tabs) { controller.saveSettings(pad); } + getStage().close(); } } diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadViewController.java index f2ef0d06..47372327 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadViewController.java @@ -2,18 +2,14 @@ package de.tobias.playpad.viewcontroller.pad; import java.io.File; import java.nio.file.Path; -import java.util.Set; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.PseudoClasses; -import de.tobias.playpad.Strings; import de.tobias.playpad.pad.Pad; 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.UnkownPadContentException; import de.tobias.playpad.pad.conntent.play.Durationable; import de.tobias.playpad.pad.listener.IPadPositionListener; import de.tobias.playpad.pad.listener.PadContentListener; @@ -25,19 +21,13 @@ import de.tobias.playpad.pad.view.IPadViewController; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.settings.ProfileSettings; -import de.tobias.playpad.view.FileDragOptionView; import de.tobias.playpad.view.PadView; import de.tobias.playpad.viewcontroller.IPadView; import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.playpad.viewcontroller.option.pad.PadSettingsViewController; -import de.tobias.utils.application.ApplicationUtils; import de.tobias.utils.util.FileUtils; -import de.tobias.utils.util.Localization; import javafx.event.ActionEvent; import javafx.event.EventHandler; -import javafx.scene.Node; -import javafx.stage.FileChooser; -import javafx.stage.FileChooser.ExtensionFilter; import javafx.stage.Stage; import javafx.util.Duration; @@ -112,55 +102,55 @@ public class PadViewController implements EventHandler<ActionEvent>, IPadViewCon } private void onNew(ActionEvent event) { - ProfileSettings settings = Profile.currentProfile().getProfileSettings(); - if (pad.getProject() != null) { - if (settings.isLiveMode() && settings.isLiveModeFile() && pad.getProject().getPlayedPlayers() > 0) { - PlayPadPlugin.getImplementation().getMainViewController().showLiveInfo(); - return; - } - } - - FileChooser chooser = new FileChooser(); - - // File Extension - ExtensionFilter extensionFilter = new ExtensionFilter(Localization.getString(Strings.File_Filter_Media), - PadContentRegistry.getSupportedFileTypes()); - chooser.getExtensionFilters().add(extensionFilter); - - // Last Folder - Object openFolder = ApplicationUtils.getApplication().getUserDefaults().getData(OPEN_FOLDER); - if (openFolder != null) { - File folder = new File(openFolder.toString()); - chooser.setInitialDirectory(folder); - } - - File file = chooser.showOpenDialog(((Node) event.getTarget()).getScene().getWindow()); - if (file != null) { - Path path = file.toPath(); - - try { - Set<PadContentConnect> connects = PadContentRegistry.getPadContentConnectsForFile(file.toPath()); - if (!connects.isEmpty()) { - if (connects.size() > 1) { - FileDragOptionView hud = new FileDragOptionView(view); - hud.showDropOptions(connects, connect -> - { - if (connect != null) { - setNewPadContent(file, path, connect); - hud.hide(); - } - }); - } else { - PadContentConnect connect = connects.iterator().next(); - setNewPadContent(file, path, connect); - } - } - } catch (UnkownPadContentException e) { - e.printStackTrace(); - } - - ApplicationUtils.getApplication().getUserDefaults().setData(OPEN_FOLDER, path.getParent().toString()); - } +// ProfileSettings settings = Profile.currentProfile().getProfileSettings(); +// if (pad.getProject() != null) { +// if (settings.isLiveMode() && settings.isLiveModeFile() && pad.getProject().getPlayedPlayers() > 0) { +// PlayPadPlugin.getImplementation().getMainViewController().showLiveInfo(); +// return; +// } +// } +// +// FileChooser chooser = new FileChooser(); +// +// // File Extension +// ExtensionFilter extensionFilter = new ExtensionFilter(Localization.getString(Strings.File_Filter_Media), +// PadContentRegistry.getSupportedFileTypes()); +// chooser.getExtensionFilters().add(extensionFilter); +// +// // Last Folder +// Object openFolder = ApplicationUtils.getApplication().getUserDefaults().getData(OPEN_FOLDER); +// if (openFolder != null) { +// File folder = new File(openFolder.toString()); +// chooser.setInitialDirectory(folder); +// } +// +// File file = chooser.showOpenDialog(((Node) event.getTarget()).getScene().getWindow()); +// if (file != null) { +// Path path = file.toPath(); +// +// try { +// Set<PadContentConnect> connects = PadContentRegistry.getPadContentConnectsForFile(file.toPath()); +// if (!connects.isEmpty()) { +// if (connects.size() > 1) { +// FileDragOptionView hud = new FileDragOptionView(view); +// hud.showDropOptions(connects, connect -> +// { +// if (connect != null) { +// setNewPadContent(file, path, connect); +// hud.hide(); +// } +// }); +// } else { +// PadContentConnect connect = connects.iterator().next(); +// setNewPadContent(file, path, connect); +// } +// } +// } catch (UnkownPadContentException e) { +// e.printStackTrace(); +// } +// +// ApplicationUtils.getApplication().getUserDefaults().setData(OPEN_FOLDER, path.getParent().toString()); +// } } private void setNewPadContent(File file, Path path, PadContentConnect connect) { diff --git a/PlayWallCore/src/de/tobias/playpad/action/ActionRegistery.java b/PlayWallCore/src/de/tobias/playpad/action/ActionRegistery.java deleted file mode 100644 index 15e3bc3b..00000000 --- a/PlayWallCore/src/de/tobias/playpad/action/ActionRegistery.java +++ /dev/null @@ -1,30 +0,0 @@ -package de.tobias.playpad.action; - -import java.util.HashMap; -import java.util.Set; - -@Deprecated -public class ActionRegistery { - - private static HashMap<String, ActionConnect> actions; - - static { - actions = new HashMap<>(); - } - - public static void registerActionConnect(ActionConnect connect) { - actions.put(connect.getType(), connect); - } - - public static ActionConnect getActionConnect(String type) { - if (actions.containsKey(type)) { - return actions.get(type); - } else { - throw new IllegalArgumentException("Type of ActionConnect does not exists: " + type); - } - } - - public static Set<String> getTypes() { - return actions.keySet(); - } -} diff --git a/PlayWallCore/src/de/tobias/playpad/design/LayoutRegistry.java b/PlayWallCore/src/de/tobias/playpad/design/LayoutRegistry.java deleted file mode 100644 index 70944c79..00000000 --- a/PlayWallCore/src/de/tobias/playpad/design/LayoutRegistry.java +++ /dev/null @@ -1,40 +0,0 @@ -package de.tobias.playpad.design; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Set; - -@Deprecated -public class LayoutRegistry { - - static { - layouts = new HashMap<>(); - } - - private static String defaultLayout; - private static HashMap<String, DesignConnect> layouts; - - public static void registerLayout(DesignConnect layoutConnect) { - layouts.put(layoutConnect.getType(), layoutConnect); - } - - public static Set<String> getTypes() { - return layouts.keySet(); - } - - public static DesignConnect getLayout(String type) { - return layouts.get(type); - } - - public static Collection<DesignConnect> getValues() { - return layouts.values(); - } - - public static String getDefaultLayout() { - return defaultLayout; - } - - public static void setDefaultLayout(String defaultLayout) { - LayoutRegistry.defaultLayout = defaultLayout; - } -} diff --git a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java b/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java deleted file mode 100644 index 929aad30..00000000 --- a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java +++ /dev/null @@ -1,72 +0,0 @@ -package de.tobias.playpad.pad.conntent; - -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -@Deprecated -public class PadContentRegistry { - - private static HashMap<String, PadContentConnect> padContents; - - static { - padContents = new HashMap<>(); - } - - public static void registerActionConnect(PadContentConnect connect) { - padContents.put(connect.getType(), connect); - } - - public static PadContentConnect getPadContentConnect(String type) throws UnkownPadContentException { - if (padContents.containsKey(type)) { - return padContents.get(type); - } else { - throw new UnkownPadContentException(type); - } - } - - public static Set<String> getTypes() { - return padContents.keySet(); - } - - public static String getContentTypeForFile(Path path) { - for (String type : padContents.keySet()) { - PadContentConnect connect = padContents.get(type); - String[] fileExtensions = connect.getSupportedTypes(); - for (String fileExtension : fileExtensions) { - if (path.toString().toLowerCase().matches("." + fileExtension)) { - return type; - } - } - } - return null; - } - - // TODO - public static Set<PadContentConnect> getPadContentConnectsForFile(Path path) throws UnkownPadContentException { - Set<PadContentConnect> connects = new HashSet<>(); - for (String type : PadContentRegistry.getTypes()) { - PadContentConnect connect = PadContentRegistry.getPadContentConnect(type); - for (String extension : connect.getSupportedTypes()) { - if (path.getFileName().toString().toLowerCase().matches("." + extension)) { - connects.add(connect); - } - } - } - return connects; - } - - public static String[] getSupportedFileTypes() { - List<String> extensions = new ArrayList<>(); - for (String type : padContents.keySet()) { - PadContentConnect connect = padContents.get(type); - String[] fileExtensions = connect.getSupportedTypes(); - Collections.addAll(extensions, fileExtensions); - } - return extensions.toArray(new String[extensions.size()]); - } -} diff --git a/PlayWallCore/src/de/tobias/playpad/pad/conntent/UnkownPadContentException.java b/PlayWallCore/src/de/tobias/playpad/pad/conntent/UnkownPadContentException.java deleted file mode 100644 index 42d375d3..00000000 --- a/PlayWallCore/src/de/tobias/playpad/pad/conntent/UnkownPadContentException.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.tobias.playpad.pad.conntent; - -@Deprecated -//TODO Remove -public class UnkownPadContentException extends Exception { - - private static final long serialVersionUID = 1L; - - public UnkownPadContentException(String type) { - super(type); - } -} diff --git a/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java b/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java index db2a747a..ef729afa 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java @@ -3,7 +3,6 @@ package de.tobias.playpad.pad.view; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.viewcontroller.IPadViewControllerV2; import javafx.css.PseudoClass; -import javafx.scene.control.ProgressBar; import javafx.scene.layout.Pane; /** @@ -67,9 +66,13 @@ public interface IPadViewV2 { public void setErrorLabelActive(boolean b); - // GUI Elemente - @Deprecated - public ProgressBar getPlayBar(); + /** + * Setzt den Fortschritt auf der PlayBar + * + * @param value + * [0, 1] + */ + public void setPlayBarProgress(double value); /** * Setzt die Playbar sichtbar. diff --git a/PlayWallCore/src/de/tobias/playpad/settings/Profile.java b/PlayWallCore/src/de/tobias/playpad/settings/Profile.java index 9ab55162..4a1e2e9c 100644 --- a/PlayWallCore/src/de/tobias/playpad/settings/Profile.java +++ b/PlayWallCore/src/de/tobias/playpad/settings/Profile.java @@ -12,8 +12,10 @@ import org.dom4j.DocumentException; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.action.MappingList; +import de.tobias.playpad.design.DesignConnect; import de.tobias.playpad.design.GlobalDesign; -import de.tobias.playpad.design.LayoutRegistry; +import de.tobias.playpad.registry.DefaultRegistry; +import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.utils.application.App; import de.tobias.utils.application.ApplicationUtils; import de.tobias.utils.application.container.PathType; @@ -71,10 +73,17 @@ public class Profile { if (layouts.containsKey(type)) { return layouts.get(type); } else { - GlobalDesign layout = LayoutRegistry.getLayout(type).newGlobalDesign(); - layouts.put(type, layout); - return layout; + try { + DefaultRegistry<DesignConnect> registry = PlayPadPlugin.getRegistryCollection().getDesigns(); + GlobalDesign layout = registry.getComponent(type).newGlobalDesign(); + layouts.put(type, layout); + return layout; + } catch (NoSuchComponentException e) { // -> Throw exception + // TODO Error Handling + e.printStackTrace(); + } } + return null; } public GlobalDesign currentLayout() { diff --git a/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java b/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java index e6c84edf..924e6010 100644 --- a/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java +++ b/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java @@ -6,9 +6,12 @@ import java.util.List; import org.dom4j.Element; +import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.PadStatus; import de.tobias.playpad.project.Project; +import de.tobias.playpad.registry.NoSuchComponentException; +import de.tobias.playpad.registry.Registry; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.viewcontroller.main.IMainViewController; import javafx.util.Duration; @@ -62,10 +65,17 @@ public class Trigger { if (itemObj instanceof Element) { Element itemElement = (Element) itemObj; String type = itemElement.attributeValue(TYPE_ATTR); - TriggerItemConnect connect = TriggerRegistry.getTriggerConnect(type); - TriggerItem item = connect.newInstance(this); - item.load(itemElement); - items.add(item); + + Registry<TriggerItemConnect> registry = PlayPadPlugin.getRegistryCollection().getTriggerItems(); + try { + TriggerItemConnect connect = registry.getComponent(type); + TriggerItem item = connect.newInstance(this); + item.load(itemElement); + items.add(item); + } catch (NoSuchComponentException e) { + e.printStackTrace(); + // TODO Error Handling + } } } } diff --git a/PlayWallCore/src/de/tobias/playpad/tigger/TriggerRegistry.java b/PlayWallCore/src/de/tobias/playpad/tigger/TriggerRegistry.java deleted file mode 100644 index 18c8967e..00000000 --- a/PlayWallCore/src/de/tobias/playpad/tigger/TriggerRegistry.java +++ /dev/null @@ -1,25 +0,0 @@ -package de.tobias.playpad.tigger; - -import java.util.HashMap; -import java.util.Set; - -@Deprecated -public class TriggerRegistry { - - private static HashMap<String, TriggerItemConnect> triggers = new HashMap<>();; - - public static void register(TriggerItemConnect connect) { - triggers.put(connect.getType(), connect); - } - - public static TriggerItemConnect getTriggerConnect(String type) { - if (triggers.containsKey(type)) { - return triggers.get(type); - } - return null; - } - - public static Set<String> getTypes() { - return triggers.keySet(); - } -} diff --git a/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java b/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java index 4c25fe94..b735be99 100644 --- a/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java +++ b/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java @@ -4,13 +4,11 @@ import java.util.List; import de.tobias.playpad.midi.MidiListener; import de.tobias.playpad.pad.view.IPadViewV2; -import de.tobias.playpad.project.Project; import de.tobias.playpad.view.main.MainLayoutConnect; import de.tobias.utils.ui.NotificationHandler; import javafx.event.EventHandler; import javafx.event.EventType; import javafx.scene.Parent; -import javafx.scene.control.Slider; import javafx.scene.input.KeyEvent; import javafx.scene.paint.Color; import javafx.stage.Screen; @@ -42,8 +40,7 @@ public interface IMainViewController extends NotificationHandler { public void applyColorsToMappers(); - @Deprecated - public default void showLiveInfo() {} + public void showLiveInfo(); public void setTitle(); @@ -58,6 +55,6 @@ public interface IMainViewController extends NotificationHandler { public void setPadVolume(double doubleValue); public void setMainLayout(MainLayoutConnect mainLayoutConnect); - + public void performLayoutDependendAction(Runnable runnable); } diff --git a/PlayWallPlugins/actionsplugin/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java b/PlayWallPlugins/actionsplugin/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java index d83f077d..3fe6c239 100644 --- a/PlayWallPlugins/actionsplugin/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java +++ b/PlayWallPlugins/actionsplugin/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java @@ -8,10 +8,7 @@ import org.dom4j.DocumentException; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.action.ActionConnect; -import de.tobias.playpad.action.ActionRegistery; import de.tobias.playpad.actionsplugin.ActionsPlugin; -import de.tobias.playpad.actionsplugin.muteaction.MuteActionConnect; -import de.tobias.playpad.actionsplugin.stopaction.StopActionConnect; import de.tobias.playpad.plugin.WindowListener; import de.tobias.playpad.registry.Registry; import de.tobias.playpad.settings.Profile; @@ -72,20 +69,17 @@ public class ActionsPluginImpl implements ActionsPlugin, ChangeListener<Boolean> @Override public void onInit(IMainViewController t) { - // TODO NullPointer - /* - t.getMenuToolbarController().getVolumeSlider().valueChangingProperty().addListener(new ChangeListener<Boolean>() { - - @Override - public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { - if (newValue && volume == -1 && Profile.currentProfile().getProfileSettings().getVolume() != 0) { + t.performLayoutDependendAction(() -> + { + t.getMenuToolbarController().getVolumeSlider().valueChangingProperty().addListener((a, b, c) -> + { + if (c && volume == -1 && Profile.currentProfile().getProfileSettings().getVolume() != 0) { volume = Profile.currentProfile().getProfileSettings().getVolume(); } else { volume = -1; } - } + }); }); - */ } }); @@ -111,9 +105,6 @@ public class ActionsPluginImpl implements ActionsPlugin, ChangeListener<Boolean> } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException | DocumentException e) { e.printStackTrace(); } - ActionRegistery.registerActionConnect(new MuteActionConnect()); - ActionRegistery.registerActionConnect(new StopActionConnect()); - muteProperty.addListener(this); System.out.println("Enable Action Plugin"); diff --git a/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java b/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java index 54e111b9..7b71b325 100644 --- a/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java +++ b/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java @@ -9,14 +9,9 @@ import org.dom4j.DocumentException; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.action.ActionConnect; -import de.tobias.playpad.action.ActionRegistery; -import de.tobias.playpad.mediaplugin.blindaction.BlindActionConnect; -import de.tobias.playpad.mediaplugin.image.ImageContentConntect; import de.tobias.playpad.mediaplugin.main.VideoPlugin; import de.tobias.playpad.mediaplugin.main.VideoSettings; -import de.tobias.playpad.mediaplugin.video.VideoContentConntect; import de.tobias.playpad.pad.conntent.PadContentConnect; -import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.plugin.SettingsListener; import de.tobias.playpad.registry.Registry; import de.tobias.playpad.settings.Profile; @@ -65,8 +60,6 @@ public class MediaPluginImpl implements VideoPlugin, SettingsListener, ChangeLis } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException | DocumentException e) { e.printStackTrace(); } - PadContentRegistry.registerActionConnect(new VideoContentConntect()); - PadContentRegistry.registerActionConnect(new ImageContentConntect()); PlayPadPlugin.getImplementation().addSettingsListener(this); @@ -91,15 +84,13 @@ public class MediaPluginImpl implements VideoPlugin, SettingsListener, ChangeLis } UpdateRegistery.registerUpdateable(new MediaPluginUpdater()); - + try { Registry<ActionConnect> padContents = PlayPadPlugin.getRegistryCollection().getActions(); padContents.loadComponentsFromFile("de/tobias/playpad/mediaplugin/assets/Actions.xml", getClass().getClassLoader()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException | DocumentException e) { e.printStackTrace(); } - ActionRegistery.registerActionConnect(new BlindActionConnect()); - blindProperty.addListener(this); System.out.println("Enable Media Plugin"); -- GitLab