diff --git a/PlayWall/src/de/tobias/playpad/VersionUpdater.java b/PlayWall/src/de/tobias/playpad/VersionUpdater.java index 045a3e7e96923ead258ea4fe3155db83d020843a..6cfb762b3ac3e2b3c7508861bf4909ab1ee13a95 100644 --- a/PlayWall/src/de/tobias/playpad/VersionUpdater.java +++ b/PlayWall/src/de/tobias/playpad/VersionUpdater.java @@ -22,8 +22,8 @@ import de.tobias.playpad.action.Mapping; import de.tobias.playpad.action.MappingSerializer; import de.tobias.playpad.action.cartaction.CartAction; import de.tobias.playpad.action.cartaction.CartAction.ControlMode; -import de.tobias.playpad.action.feedback.DoubleSimpleFeedback; import de.tobias.playpad.action.mapper.MidiMapper; +import de.tobias.playpad.action.mapper.feedback.DoubleMidiFeedback; import de.tobias.playpad.project.Project; import de.tobias.playpad.project.ProjectReference; import de.tobias.playpad.settings.ProfileReference; @@ -175,7 +175,7 @@ public class VersionUpdater implements UpdateService { int feedbackEvent = Integer.valueOf(feedbackEventElement.element("MidiVelocity").getStringValue()); int feedbackDefault = Integer.valueOf(feedbackDefaultElement.element("MidiVelocity").getStringValue()); - DoubleSimpleFeedback doubleSimpleFeedback = new DoubleSimpleFeedback(feedbackDefault, feedbackEvent); + DoubleMidiFeedback doubleSimpleFeedback = new DoubleMidiFeedback(feedbackDefault, feedbackEvent); mapper.setFeedback(doubleSimpleFeedback); } } diff --git a/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapper.java b/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapper.java index 4777e9ef78d5aaf08b4e5b9e999a49e2ab6626ba..cdc25969f5935c889785b2f9cbfa3ba1a717dc5e 100644 --- a/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapper.java +++ b/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapper.java @@ -60,10 +60,6 @@ public class KeyboardMapper extends Mapper { } } - // Not Used for Keyboards - @Override - protected void initFeedback() {} - private static final String KEY = "key"; private static final String CODE = "code"; @@ -74,7 +70,7 @@ public class KeyboardMapper extends Mapper { } @Override - public void save(Element element, Action action) { + public void save(Element element) { element.addAttribute(KEY, key); element.addAttribute(CODE, code.name()); } diff --git a/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapper.java b/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapper.java index ebde690e52f56a3f0d43702a4e3a7a64890a75a3..f6f60e3937638419efae957f1133e34df713eee7 100644 --- a/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapper.java +++ b/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapper.java @@ -8,11 +8,11 @@ import de.tobias.playpad.Strings; import de.tobias.playpad.action.Action; import de.tobias.playpad.action.feedback.ColorAssociator; import de.tobias.playpad.action.feedback.DisplayableFeedbackColor; -import de.tobias.playpad.action.feedback.DoubleSimpleFeedback; import de.tobias.playpad.action.feedback.Feedback; import de.tobias.playpad.action.feedback.FeedbackMessage; import de.tobias.playpad.action.feedback.FeedbackType; -import de.tobias.playpad.action.feedback.SingleSimpleFeedback; +import de.tobias.playpad.action.mapper.feedback.DoubleMidiFeedback; +import de.tobias.playpad.action.mapper.feedback.SingleMidiFeedback; import de.tobias.playpad.action.mididevice.Device; import de.tobias.playpad.action.mididevice.DeviceColorAssociatorConnector; import de.tobias.playpad.midi.Midi; @@ -63,12 +63,12 @@ public class MidiMapper extends Mapper implements ColorAssociator, MapperFeedbac } @Override - protected void initFeedback() { + public void initFeedback() { if (feedback == null || this.feedbackType != super.feedbackType) { if (super.feedbackType == FeedbackType.SINGLE) { - feedback = new SingleSimpleFeedback(); + feedback = new SingleMidiFeedback(); } else if (super.feedbackType == FeedbackType.DOUBLE) { - feedback = new DoubleSimpleFeedback(); + feedback = new DoubleMidiFeedback(); } } this.feedbackType = super.feedbackType; @@ -77,7 +77,8 @@ public class MidiMapper extends Mapper implements ColorAssociator, MapperFeedbac public Feedback getFeedback() { return feedback; } - + + @Deprecated public void setFeedback(Feedback feedback) { this.feedback = feedback; } @@ -185,7 +186,7 @@ public class MidiMapper extends Mapper implements ColorAssociator, MapperFeedbac } @Override - public void save(Element element, Action action) { + public void save(Element element) { element.addAttribute(MIDI_COMMAND, String.valueOf(command)); element.addAttribute(MIDI_KEY, String.valueOf(key)); diff --git a/PlayWallCore/src/de/tobias/playpad/action/feedback/DoubleSimpleFeedback.java b/PlayWall/src/de/tobias/playpad/action/mapper/feedback/DoubleMidiFeedback.java similarity index 81% rename from PlayWallCore/src/de/tobias/playpad/action/feedback/DoubleSimpleFeedback.java rename to PlayWall/src/de/tobias/playpad/action/mapper/feedback/DoubleMidiFeedback.java index e82b05b1b7e16d1f9d09fa8ed9d55e7e9df33db1..3e16e53d3726d6cf9ba7f0ee881d39c095c43406 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/feedback/DoubleSimpleFeedback.java +++ b/PlayWall/src/de/tobias/playpad/action/mapper/feedback/DoubleMidiFeedback.java @@ -1,20 +1,31 @@ -package de.tobias.playpad.action.feedback; +package de.tobias.playpad.action.mapper.feedback; import org.dom4j.Element; -public class DoubleSimpleFeedback extends Feedback { +import de.tobias.playpad.action.feedback.Feedback; +import de.tobias.playpad.action.feedback.FeedbackMessage; + +/** + * Implementierung eines 2 State Feedbacks für MIDI Geräte. + * + * @author tobias + * + * @since 5.0.0 + * + */ +public class DoubleMidiFeedback extends Feedback { private static final int INIT_FEEDBACK_VALUE = 0; private int feedbackDefaultValue; // e.g. Color on an LaunchPad private int feedbackEventValue; // e.g. Color on an LaunchPad - public DoubleSimpleFeedback() { + public DoubleMidiFeedback() { this.feedbackDefaultValue = INIT_FEEDBACK_VALUE; this.feedbackEventValue = INIT_FEEDBACK_VALUE; } - public DoubleSimpleFeedback(int feedbackDefaultValue, int feedbackEventValue) { + public DoubleMidiFeedback(int feedbackDefaultValue, int feedbackEventValue) { this.feedbackDefaultValue = feedbackDefaultValue; this.feedbackEventValue = feedbackEventValue; } @@ -80,7 +91,7 @@ public class DoubleSimpleFeedback extends Feedback { @Override public Feedback cloneFeedback() throws CloneNotSupportedException { - DoubleSimpleFeedback feedback = (DoubleSimpleFeedback) super.clone(); + DoubleMidiFeedback feedback = (DoubleMidiFeedback) super.clone(); feedback.feedbackDefaultValue = feedbackDefaultValue; feedback.feedbackEventValue = feedbackEventValue; diff --git a/PlayWallCore/src/de/tobias/playpad/action/feedback/SingleSimpleFeedback.java b/PlayWall/src/de/tobias/playpad/action/mapper/feedback/SingleMidiFeedback.java similarity index 73% rename from PlayWallCore/src/de/tobias/playpad/action/feedback/SingleSimpleFeedback.java rename to PlayWall/src/de/tobias/playpad/action/mapper/feedback/SingleMidiFeedback.java index 1981650351ebcd05ca07954dea7ba158e1a36de5..dfd37f546c945cdec28058292c4ad7f53c3688c6 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/feedback/SingleSimpleFeedback.java +++ b/PlayWall/src/de/tobias/playpad/action/mapper/feedback/SingleMidiFeedback.java @@ -1,18 +1,29 @@ -package de.tobias.playpad.action.feedback; +package de.tobias.playpad.action.mapper.feedback; import org.dom4j.Element; -public class SingleSimpleFeedback extends Feedback { +import de.tobias.playpad.action.feedback.Feedback; +import de.tobias.playpad.action.feedback.FeedbackMessage; + +/** + * Implementierung eines 1 State Feedbacks für MIDI Geräte. + * + * @author tobias + * + * @since 5.0.0 + * + */ +public class SingleMidiFeedback extends Feedback { private static final int INIT_FEEDBACK_VALUE = 0; private int feedbackValue; // e.g. Color on an LaunchPad - public SingleSimpleFeedback() { + public SingleMidiFeedback() { this.feedbackValue = INIT_FEEDBACK_VALUE; } - public SingleSimpleFeedback(int feedbackValue) { + public SingleMidiFeedback(int feedbackValue) { this.feedbackValue = feedbackValue; } @@ -63,7 +74,7 @@ public class SingleSimpleFeedback extends Feedback { @Override public Feedback cloneFeedback() throws CloneNotSupportedException { - SingleSimpleFeedback feedback = (SingleSimpleFeedback) super.clone(); + SingleMidiFeedback feedback = (SingleMidiFeedback) super.clone(); feedback.feedbackValue = feedbackValue; diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java index bb142d1a0c0862e9a4db07a5243c130e9de75f8d..4994b8d2c29b2d7d43a72020c512cf9a46e238ef 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java @@ -259,7 +259,7 @@ public class DesktopPadView implements IPadViewV2 { } @Override - public void addDefaultButton(Pad pad) { + public void addDefaultElement(Pad pad) { if (pad != null) { if (pad.getContent() != null) { if (pad.getContent() instanceof Pauseable) { @@ -291,32 +291,30 @@ public class DesktopPadView implements IPadViewV2 { } @Override - public void applyStyleClasses() { - Pad pad = getViewController().getPad(); - - superRoot.getStyleClass().addAll("pad", "pad" + pad.getIndex()); + public void applyStyleClasses(int index) { + superRoot.getStyleClass().addAll("pad", "pad" + index); - indexLabel.getStyleClass().addAll("pad-index", "pad" + pad.getIndex() + "-index", "pad-info", "pad" + pad.getIndex() + "-info"); - timeLabel.getStyleClass().addAll("pad-time", "pad" + pad.getIndex() + "-time", "pad-info", "pad" + pad.getIndex() + "-info"); - loopLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - triggerLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - errorLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + pad.getIndex() + "-icon"); + indexLabel.getStyleClass().addAll("pad-index", "pad" + index + "-index", "pad-info", "pad" + index + "-info"); + timeLabel.getStyleClass().addAll("pad-time", "pad" + index + "-time", "pad-info", "pad" + index + "-info"); + loopLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + index + "-icon"); + triggerLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + index + "-icon"); + errorLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + index + "-icon"); - preview.getChildren().forEach(i -> i.getStyleClass().addAll("pad-title", "pad" + pad.getIndex() + "-title")); + preview.getChildren().forEach(i -> i.getStyleClass().addAll("pad-title", "pad" + index + "-title")); - playBar.getStyleClass().addAll("pad-playbar", "pad" + pad.getIndex() + "-playbar"); + playBar.getStyleClass().addAll("pad-playbar", "pad" + index + "-playbar"); - playButton.getStyleClass().addAll("pad-button", "pad" + pad.getIndex() + "-button"); - pauseButton.getStyleClass().addAll("pad-button", "pad" + pad.getIndex() + "-button"); - stopButton.getStyleClass().addAll("pad-button", "pad" + pad.getIndex() + "-button"); - newButton.getStyleClass().addAll("pad-button", "pad" + pad.getIndex() + "-button"); - settingsButton.getStyleClass().addAll("pad-button", "pad" + pad.getIndex() + "-button"); + playButton.getStyleClass().addAll("pad-button", "pad" + index + "-button"); + pauseButton.getStyleClass().addAll("pad-button", "pad" + index + "-button"); + stopButton.getStyleClass().addAll("pad-button", "pad" + index + "-button"); + newButton.getStyleClass().addAll("pad-button", "pad" + index + "-button"); + settingsButton.getStyleClass().addAll("pad-button", "pad" + index + "-button"); - playButton.getGraphic().getStyleClass().addAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - pauseButton.getGraphic().getStyleClass().addAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - stopButton.getGraphic().getStyleClass().addAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - newButton.getGraphic().getStyleClass().addAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - settingsButton.getGraphic().getStyleClass().addAll("pad-icon", "pad" + pad.getIndex() + "-icon"); + playButton.getGraphic().getStyleClass().addAll("pad-icon", "pad" + index + "-icon"); + pauseButton.getGraphic().getStyleClass().addAll("pad-icon", "pad" + index + "-icon"); + stopButton.getGraphic().getStyleClass().addAll("pad-icon", "pad" + index + "-icon"); + newButton.getGraphic().getStyleClass().addAll("pad-icon", "pad" + index + "-icon"); + settingsButton.getGraphic().getStyleClass().addAll("pad-icon", "pad" + index + "-icon"); buttonBox.getStyleClass().add("pad-button-box"); root.getStyleClass().add("pad-root"); @@ -325,30 +323,31 @@ public class DesktopPadView implements IPadViewV2 { @Override public void removeStyleClasses() { Pad pad = getViewController().getPad(); + int index = pad.getIndex(); - superRoot.getStyleClass().removeAll("pad", "pad" + pad.getIndex()); + superRoot.getStyleClass().removeAll("pad", "pad" + index); - indexLabel.getStyleClass().removeAll("pad-index", "pad" + pad.getIndex() + "-index", "pad-info", "pad" + pad.getIndex() + "-info"); - timeLabel.getStyleClass().removeAll("pad-time", "pad" + pad.getIndex() + "-time", "pad-info", "pad" + pad.getIndex() + "-info"); - loopLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - triggerLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - errorLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + pad.getIndex() + "-icon"); + indexLabel.getStyleClass().removeAll("pad-index", "pad" + index + "-index", "pad-info", "pad" + index + "-info"); + timeLabel.getStyleClass().removeAll("pad-time", "pad" + index + "-time", "pad-info", "pad" + index + "-info"); + loopLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); + triggerLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); + errorLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); - preview.getChildren().forEach(i -> i.getStyleClass().removeAll("pad-title", "pad" + pad.getIndex() + "-title")); + preview.getChildren().forEach(i -> i.getStyleClass().removeAll("pad-title", "pad" + index + "-title")); - playBar.getStyleClass().removeAll("pad-playbar", "pad" + pad.getIndex() + "-playbar"); + playBar.getStyleClass().removeAll("pad-playbar", "pad" + index + "-playbar"); - playButton.getStyleClass().removeAll("pad-button", "pad" + pad.getIndex() + "-button"); - pauseButton.getStyleClass().removeAll("pad-button", "pad" + pad.getIndex() + "-button"); - stopButton.getStyleClass().removeAll("pad-button", "pad" + pad.getIndex() + "-button"); - newButton.getStyleClass().removeAll("pad-button", "pad" + pad.getIndex() + "-button"); - settingsButton.getStyleClass().removeAll("pad-button", "pad" + pad.getIndex() + "-button"); + playButton.getStyleClass().removeAll("pad-button", "pad" + index + "-button"); + pauseButton.getStyleClass().removeAll("pad-button", "pad" + index + "-button"); + stopButton.getStyleClass().removeAll("pad-button", "pad" + index + "-button"); + newButton.getStyleClass().removeAll("pad-button", "pad" + index + "-button"); + settingsButton.getStyleClass().removeAll("pad-button", "pad" + index + "-button"); - playButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - pauseButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - stopButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - newButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - settingsButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + pad.getIndex() + "-icon"); + playButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); + pauseButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); + stopButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); + newButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); + settingsButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); buttonBox.getStyleClass().add("pad-button-box"); root.getStyleClass().add("pad-root"); diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java index 68581c2c4ee8c9e6bb9b5e359a54012ea8e4e360..d0666f0ec80ecea56054fff3315cb54b53a3bf7c 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java @@ -206,7 +206,7 @@ public class TouchPadView implements IPadViewV2 { } @Override - public void addDefaultButton(Pad pad) { + public void addDefaultElement(Pad pad) { infoBox.getChildren().setAll(indexLabel, loopLabel, triggerLabel, errorLabel, timeLabel); // alle Labels in der InfoBox sollen die gleiche Höhe haben, damit die Icons auf gleicher höhe sind @@ -218,20 +218,18 @@ public class TouchPadView implements IPadViewV2 { } @Override - public void applyStyleClasses() { - Pad pad = getViewController().getPad(); - - superRoot.getStyleClass().addAll("pad", "pad" + pad.getIndex()); + public void applyStyleClasses(int index) { + superRoot.getStyleClass().addAll("pad", "pad" + index); - indexLabel.getStyleClass().addAll("pad-index", "pad" + pad.getIndex() + "-index", "pad-info", "pad" + pad.getIndex() + "-info"); - timeLabel.getStyleClass().addAll("pad-time", "pad" + pad.getIndex() + "-time", "pad-info", "pad" + pad.getIndex() + "-info"); - loopLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - triggerLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - errorLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + pad.getIndex() + "-icon"); + indexLabel.getStyleClass().addAll("pad-index", "pad" + index + "-index", "pad-info", "pad" + index + "-info"); + timeLabel.getStyleClass().addAll("pad-time", "pad" + index + "-time", "pad-info", "pad" + index + "-info"); + loopLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + index + "-icon"); + triggerLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + index + "-icon"); + errorLabel.getGraphic().getStyleClass().addAll("pad-icon", "pad" + index + "-icon"); - preview.getChildren().forEach(i -> i.getStyleClass().addAll("pad-title", "pad" + pad.getIndex() + "-title")); + preview.getChildren().forEach(i -> i.getStyleClass().addAll("pad-title", "pad" + index + "-title")); - playBar.getStyleClass().addAll("pad-playbar", "pad" + pad.getIndex() + "-playbar"); + playBar.getStyleClass().addAll("pad-playbar", "pad" + index + "-playbar"); root.getStyleClass().add("pad-root"); } @@ -239,18 +237,19 @@ public class TouchPadView implements IPadViewV2 { @Override public void removeStyleClasses() { Pad pad = getViewController().getPad(); + int index = pad.getIndex(); - superRoot.getStyleClass().removeAll("pad", "pad" + pad.getIndex()); + superRoot.getStyleClass().removeAll("pad", "pad" + index); - indexLabel.getStyleClass().removeAll("pad-index", "pad" + pad.getIndex() + "-index", "pad-info", "pad" + pad.getIndex() + "-info"); - timeLabel.getStyleClass().removeAll("pad-time", "pad" + pad.getIndex() + "-time", "pad-info", "pad" + pad.getIndex() + "-info"); - loopLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - triggerLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + pad.getIndex() + "-icon"); - errorLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + pad.getIndex() + "-icon"); + indexLabel.getStyleClass().removeAll("pad-index", "pad" + index + "-index", "pad-info", "pad" + index + "-info"); + timeLabel.getStyleClass().removeAll("pad-time", "pad" + index + "-time", "pad-info", "pad" + index + "-info"); + loopLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); + triggerLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); + errorLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); - preview.getChildren().forEach(i -> i.getStyleClass().removeAll("pad-title", "pad" + pad.getIndex() + "-title")); + preview.getChildren().forEach(i -> i.getStyleClass().removeAll("pad-title", "pad" + index + "-title")); - playBar.getStyleClass().removeAll("pad-playbar", "pad" + pad.getIndex() + "-playbar"); + playBar.getStyleClass().removeAll("pad-playbar", "pad" + index + "-playbar"); root.getStyleClass().add("pad-root"); } diff --git a/PlayWall/src/de/tobias/playpad/pad/listener/PadContentListener.java b/PlayWall/src/de/tobias/playpad/pad/listener/PadContentListener.java index 981350713bdbba269a6775507b5dcd22f1e67435..cb47601c8299bedfd11902632276d79027408617 100644 --- a/PlayWall/src/de/tobias/playpad/pad/listener/PadContentListener.java +++ b/PlayWall/src/de/tobias/playpad/pad/listener/PadContentListener.java @@ -24,7 +24,7 @@ public class PadContentListener implements ChangeListener<PadContent> { public void changed(ObservableValue<? extends PadContent> observable, PadContent oldValue, PadContent newValue) { // wenn Content change, update preview & buttons controller.getView().setContentView(pad); - controller.getView().addDefaultButton(pad); + controller.getView().addDefaultElement(pad); controller.updateButtonDisable(); controller.updateTimeLabel(); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/mapper/MidiMapperViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/mapper/MidiMapperViewController.java index a24809d66ebaa5437f350ebd1dc746279eb53599..c6f06e4b1d82e9cd421063505ebf0313f11cfc38 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/mapper/MidiMapperViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/mapper/MidiMapperViewController.java @@ -4,12 +4,12 @@ import javax.sound.midi.MidiMessage; import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.Strings; -import de.tobias.playpad.action.feedback.DoubleSimpleFeedback; import de.tobias.playpad.action.feedback.FeedbackType; -import de.tobias.playpad.action.feedback.SingleSimpleFeedback; import de.tobias.playpad.action.mapper.Mapper; import de.tobias.playpad.action.mapper.MapperViewController; import de.tobias.playpad.action.mapper.MidiMapper; +import de.tobias.playpad.action.mapper.feedback.DoubleMidiFeedback; +import de.tobias.playpad.action.mapper.feedback.SingleMidiFeedback; import de.tobias.playpad.midi.Midi; import de.tobias.playpad.midi.MidiListener; import de.tobias.playpad.viewcontroller.option.feedback.DoubleFeedbackViewController; @@ -135,9 +135,9 @@ public class MidiMapperViewController extends MapperViewController implements Mi } // add new Elements if (mapper.getFeedbackType() == FeedbackType.SINGLE) { - feedbackController = new SingleFeedbackViewController((SingleSimpleFeedback) mapper.getFeedback(), device.getColors()); + feedbackController = new SingleFeedbackViewController((SingleMidiFeedback) mapper.getFeedback(), device.getColors()); } else if (mapper.getFeedbackType() == FeedbackType.DOUBLE) { - feedbackController = new DoubleFeedbackViewController((DoubleSimpleFeedback) mapper.getFeedback(), device.getColors()); + feedbackController = new DoubleFeedbackViewController((DoubleMidiFeedback) mapper.getFeedback(), device.getColors()); } showFeedback(); } diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/feedback/DoubleFeedbackViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/feedback/DoubleFeedbackViewController.java index 24c6cfb81e5544f1beb8ac696a4a96555a170cf8..81b5e1992d378e5a8c151cdcf0896b5ee17d0104 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/feedback/DoubleFeedbackViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/feedback/DoubleFeedbackViewController.java @@ -7,8 +7,8 @@ import org.controlsfx.control.PopOver.ArrowLocation; import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.action.feedback.DisplayableFeedbackColor; -import de.tobias.playpad.action.feedback.DoubleSimpleFeedback; import de.tobias.playpad.action.feedback.FeedbackMessage; +import de.tobias.playpad.action.mapper.feedback.DoubleMidiFeedback; import de.tobias.playpad.action.mididevice.Device; import de.tobias.playpad.midi.Midi; import de.tobias.playpad.view.ColorView; @@ -36,9 +36,9 @@ public class DoubleFeedbackViewController extends ContentViewController { private PopOver colorChooser; - private DoubleSimpleFeedback feedback; + private DoubleMidiFeedback feedback; - public DoubleFeedbackViewController(DoubleSimpleFeedback feedback, DisplayableFeedbackColor[] colors) { + public DoubleFeedbackViewController(DoubleMidiFeedback feedback, DisplayableFeedbackColor[] colors) { super("doubleFeedback", "de/tobias/playpad/assets/view/option/feedback/", PlayPadMain.getUiResourceBundle()); this.feedback = feedback; @@ -89,11 +89,11 @@ public class DoubleFeedbackViewController extends ContentViewController { colorChooser.hide(); if (item instanceof DisplayableFeedbackColor) { if (event.getSource() == colorChooseDefaultButton) { - feedback.setFeedbackDefaultValue(((DisplayableFeedbackColor) item).midiVelocity()); + feedback.setFeedbackDefaultValue(((DisplayableFeedbackColor) item).mapperFeedbackValue()); colorPreviewDefault.setFill(item.getPaint()); setColorChooseButtonColor(item.getPaint(), colorChooseDefaultButton); } else if (event.getSource() == colorChooseEventButton) { - feedback.setFeedbackEventValue(((DisplayableFeedbackColor) item).midiVelocity()); + feedback.setFeedbackEventValue(((DisplayableFeedbackColor) item).mapperFeedbackValue()); colorPreviewEvent.setFill(item.getPaint()); setColorChooseButtonColor(item.getPaint(), colorChooseEventButton); } diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/feedback/SingleFeedbackViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/feedback/SingleFeedbackViewController.java index 7a737802e3b7579ce6ea35d480f8cb79356fb002..94cfd8b3228a1e354861e70e34948b09e345036b 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/feedback/SingleFeedbackViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/feedback/SingleFeedbackViewController.java @@ -8,7 +8,7 @@ import org.controlsfx.control.PopOver.ArrowLocation; import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.action.feedback.DisplayableFeedbackColor; import de.tobias.playpad.action.feedback.FeedbackMessage; -import de.tobias.playpad.action.feedback.SingleSimpleFeedback; +import de.tobias.playpad.action.mapper.feedback.SingleMidiFeedback; import de.tobias.playpad.action.mididevice.Device; import de.tobias.playpad.midi.Midi; import de.tobias.playpad.view.ColorView; @@ -32,9 +32,9 @@ public class SingleFeedbackViewController extends ContentViewController { private PopOver colorChooser; - private SingleSimpleFeedback feedback; + private SingleMidiFeedback feedback; - public SingleFeedbackViewController(SingleSimpleFeedback feedback, DisplayableFeedbackColor[] colors) { + public SingleFeedbackViewController(SingleMidiFeedback feedback, DisplayableFeedbackColor[] colors) { super("singleFeedback", "de/tobias/playpad/assets/view/option/feedback/", PlayPadMain.getUiResourceBundle()); this.feedback = feedback; @@ -70,7 +70,7 @@ public class SingleFeedbackViewController extends ContentViewController { colorChooser.hide(); if (item instanceof DisplayableFeedbackColor) { if (event.getSource() == colorChooseDefaultButton) { - feedback.setFeedbackValue(((DisplayableFeedbackColor) item).midiVelocity()); + feedback.setFeedbackValue(((DisplayableFeedbackColor) item).mapperFeedbackValue()); colorPreviewDefault.setFill(item.getPaint()); setColorChooseButtonColor(item.getPaint(), colorChooseDefaultButton); } diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadDragListener.java b/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadDragListener.java index 2dc9956dd7cdb1ccdac33250233295279f75a4e3..2c86eb3ae252bdddaba728b9d7eb2fb6e32acfb3 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadDragListener.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadDragListener.java @@ -143,7 +143,7 @@ public class PadDragListener { if (sourcePad.getController() != null) { IPadViewV2 padView = sourcePad.getController().getView(); padView.setContentView(sourcePad); - padView.addDefaultButton(sourcePad); + padView.addDefaultElement(sourcePad); } } } diff --git a/PlayWallCore/src/de/tobias/playpad/Displayable.java b/PlayWallCore/src/de/tobias/playpad/Displayable.java index 5f5499a10c85d22d2ae3b9e364223d4ae6ba6bc8..232003e4486219ce97106c3d4abfac96c9d015cc 100644 --- a/PlayWallCore/src/de/tobias/playpad/Displayable.java +++ b/PlayWallCore/src/de/tobias/playpad/Displayable.java @@ -14,6 +14,8 @@ public interface Displayable { /** * Optional Method for a displayable cell + * + * @return Einstellungen für dieses Objetkt. */ public default ContentViewController getSettingsViewController() { return null; diff --git a/PlayWallCore/src/de/tobias/playpad/PlayPad.java b/PlayWallCore/src/de/tobias/playpad/PlayPad.java index 877bd5d97fc07a4e84b89911fa0c063e8663033c..ba0648a62c2a20fd92a59f98fe721460c17dfe31 100644 --- a/PlayWallCore/src/de/tobias/playpad/PlayPad.java +++ b/PlayWallCore/src/de/tobias/playpad/PlayPad.java @@ -76,7 +76,6 @@ public interface PlayPad { * * @return PadListener * - * @see 5.0.0 */ public List<PadListener> getPadListener(); diff --git a/PlayWallCore/src/de/tobias/playpad/PlayPadPlugin.java b/PlayWallCore/src/de/tobias/playpad/PlayPadPlugin.java index 148f84bb2021ae1036adc6e1f36a048b764cb074..cdd076538f46abdcba1c2e01db8c252360a0723d 100644 --- a/PlayWallCore/src/de/tobias/playpad/PlayPadPlugin.java +++ b/PlayWallCore/src/de/tobias/playpad/PlayPadPlugin.java @@ -6,7 +6,7 @@ public final class PlayPadPlugin { private static PlayPad implementation; private static RegistryCollection registryCollection; - + private Project currentProject; public static PlayPad getImplementation() { @@ -20,7 +20,7 @@ public final class PlayPadPlugin { /** * Gibt die Implementierung für die Registries * - * @return + * @return Registry Collection Impl */ public static RegistryCollection getRegistryCollection() { return registryCollection; @@ -29,7 +29,7 @@ public final class PlayPadPlugin { protected static void setRegistryCollection(RegistryCollection registryCollection) { PlayPadPlugin.registryCollection = registryCollection; } - + public Project getCurrentproject() { return currentProject; } diff --git a/PlayWallCore/src/de/tobias/playpad/action/Action.java b/PlayWallCore/src/de/tobias/playpad/action/Action.java index f142d444ac3b5b0486578fa0c0b406c8ef4dec12..6f7b10278df92f618eb7da1979c2dce02a33d5df 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/Action.java +++ b/PlayWallCore/src/de/tobias/playpad/action/Action.java @@ -13,12 +13,13 @@ import de.tobias.playpad.project.Project; import de.tobias.playpad.viewcontroller.main.IMainViewController; /** - * This class is the base of all program actions, that can be triggered by a mapper. This class handle all input form an mapper. + * Diese Klasse ist die Basis für alle Actions, die durch Mapper auftreten. Die Klasse verarbeitet dabei allen Input und führt die Listener + * aus. * * @author tobias * @version 5.0.0 * - * @see Mapper + * @see Mapper Mapper sind die Schnittstelle zur Hardware und bestandteil einer Action. */ public abstract class Action implements ActionDisplayable, Cloneable { @@ -30,7 +31,7 @@ public abstract class Action implements ActionDisplayable, Cloneable { * @param mapping * mapping */ - protected void setMapping(Mapping mapping) { + protected void setMappingRef(Mapping mapping) { this.mapping = mapping; } @@ -81,6 +82,9 @@ public abstract class Action implements ActionDisplayable, Cloneable { */ public abstract void initFeedback(Project project, IMainViewController controller); + /** + * Cleared das Feedback auf dem Mapper für diese Action. + */ public abstract void clearFeedback(); /** @@ -146,5 +150,12 @@ public abstract class Action implements ActionDisplayable, Cloneable { */ public abstract void save(Element root); + /** + * Dupliziert das Objekt. + * + * @return Cloned Object + * @throws CloneNotSupportedException + * Clone Fehlgeschlagen + */ public abstract Action cloneAction() throws CloneNotSupportedException; } diff --git a/PlayWallCore/src/de/tobias/playpad/action/ActionConnect.java b/PlayWallCore/src/de/tobias/playpad/action/ActionConnect.java index ae744a776ddb3c62c7f9055153867cdfca71fbbd..65ba085750b4daaef586f39f12c1448aa914bd74 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/ActionConnect.java +++ b/PlayWallCore/src/de/tobias/playpad/action/ActionConnect.java @@ -5,15 +5,59 @@ import java.util.List; import de.tobias.playpad.settings.Profile; import javafx.scene.control.TreeItem; +/** + * Verwalter einer Action für die Instance und GUI. + * + * @author tobias + * + * @since 5.0.0 + * + * @see Action Implementierung der eigentlichen Action. + */ public abstract class ActionConnect { + /** + * Erstellt ein TreeItem für die Grupierung der Actions. + * + * @param actions + * Liste der alle Actionen dieses Types. + * @param mapping + * Mapping, indem die Actions sind. + * @return TreeItem + */ public abstract TreeItem<ActionDisplayable> getTreeViewForActions(List<Action> actions, Mapping mapping); + /** + * Initialisiert ein Mapping mit allen möglichen Action Varianten. Dies ist nötig, damit alle möglichen Actions in den Einstellungen + * aufgelistet werden können. + * + * @param mapping + * Mapping + * @param profile + * Profile für Einstellungen + */ public abstract void initActionType(Mapping mapping, Profile profile); + /** + * Erstellt eine neue Instance der Aktion. + * + * @return Neue Instance. + */ public abstract Action newInstance(); + /** + * Gibt die Art der Action zurück. Gibt Auskunft über die Anordnung in den Einstellungen. + * + * @return Art der Aktion + * + * @see ActionType + */ public abstract ActionType geActionType(); + /** + * Gibt die ID der Action zurück. + * + * @return ID + */ public abstract String getType(); } diff --git a/PlayWallCore/src/de/tobias/playpad/action/ActionDisplayable.java b/PlayWallCore/src/de/tobias/playpad/action/ActionDisplayable.java index a96090537df984e9814f03ec78111013beae71f6..5c89514dd9d4c79007b656e10056245b1f1a1d45 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/ActionDisplayable.java +++ b/PlayWallCore/src/de/tobias/playpad/action/ActionDisplayable.java @@ -4,8 +4,26 @@ import de.tobias.playpad.Displayable; import de.tobias.playpad.viewcontroller.IMappingTabViewController; import de.tobias.utils.ui.ContentViewController; +/** + * Einn zusätzliches Interface für die Klasse {@link ActionConnect} oder {@link Action} mit der es möglich ist für ein ActionType oder eine + * Action Einstellungen anzuzeigen. + * + * @author tobias + * + * @since 5.0.0 + * + */ public interface ActionDisplayable extends Displayable { + /** + * Erlaubt es einen ViewController für diesen ActionType oder die Action zu schalten. + * + * @param mapping + * Aktuelles Mapping + * @param controller + * Aktueller ViewController für das Mapping + * @return ViewController für den ActionType + */ public default ContentViewController getActionSettingsViewController(Mapping mapping, IMappingTabViewController controller) { return null; } diff --git a/PlayWallCore/src/de/tobias/playpad/action/ActionSerializer.java b/PlayWallCore/src/de/tobias/playpad/action/ActionSerializer.java index 321714fecc6ef56931f4f830f4cc6d9f4da4e98f..ff4c629b9b32b37ce6c1625db046ae5eed342927 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/ActionSerializer.java +++ b/PlayWallCore/src/de/tobias/playpad/action/ActionSerializer.java @@ -6,6 +6,7 @@ import org.dom4j.Element; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.action.mapper.Mapper; +import de.tobias.playpad.action.mapper.MapperSerializer; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.xml.XMLDeserializer; import de.tobias.playpad.xml.XMLHandler; diff --git a/PlayWallCore/src/de/tobias/playpad/action/ActionType.java b/PlayWallCore/src/de/tobias/playpad/action/ActionType.java index 21836940fd76aa70f06818d1b82f7df76ec5068d..4d562d989a06706773a044766db51e66e77f7027 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/ActionType.java +++ b/PlayWallCore/src/de/tobias/playpad/action/ActionType.java @@ -1,8 +1,21 @@ package de.tobias.playpad.action; +/** + * Art der Action. + * + * @author tobias + * + * @since 5.0.0 + */ public enum ActionType { + /** + * Steuerung einer Action, wie Kachel. + */ CONTROL, + /** + * Einstellungen ändern, wie Mute. + */ SETTINGS; } diff --git a/PlayWallCore/src/de/tobias/playpad/action/Mapping.java b/PlayWallCore/src/de/tobias/playpad/action/Mapping.java index 718327a13ec05f214fcd90c341566e9573d32b3a..b4a422d8f6e070fbedf7e4e38a910cefea840c8b 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/Mapping.java +++ b/PlayWallCore/src/de/tobias/playpad/action/Mapping.java @@ -7,9 +7,8 @@ import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; -import com.sun.scenario.effect.ColorAdjust; - import de.tobias.playpad.PlayPadPlugin; +import de.tobias.playpad.action.feedback.ColorAdjuster; import de.tobias.playpad.action.mapper.Mapper; import de.tobias.playpad.action.mapper.MapperConnect; import de.tobias.playpad.action.mapper.MapperConnectFeedbackable; @@ -21,6 +20,7 @@ import de.tobias.playpad.viewcontroller.main.IMainViewController; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; +// COMMENT Mapping public class Mapping implements Cloneable, ActionDisplayable { private String name; @@ -92,7 +92,7 @@ public class Mapping implements Cloneable, ActionDisplayable { } } mapping.put(newAction, new ArrayList<>()); - newAction.setMapping(this); + newAction.setMappingRef(this); return true; } @@ -180,7 +180,7 @@ public class Mapping implements Cloneable, ActionDisplayable { } public void adjustPadColorToMapper(Project project) { - + ColorAdjuster.applyColorsToMappers(project); } @Override diff --git a/PlayWallCore/src/de/tobias/playpad/action/MappingList.java b/PlayWallCore/src/de/tobias/playpad/action/MappingList.java index bd9774d15abb108db63b4c1063fd9060894c77a9..0f0f03c9e7e5104743c44a4db388825481042a88 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/MappingList.java +++ b/PlayWallCore/src/de/tobias/playpad/action/MappingList.java @@ -19,6 +19,7 @@ import org.dom4j.io.XMLWriter; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.xml.XMLHandler; +// COMMENT MappingList public class MappingList extends ArrayList<Mapping> { private static final long serialVersionUID = 1L; @@ -93,12 +94,12 @@ public class MappingList extends ArrayList<Mapping> { XMLHandler<Mapping> handler = new XMLHandler<>(rootElement); handler.saveElements(MAPPING, this, new MappingSerializer()); - + if (Files.notExists(path)) { Files.createDirectories(path.getParent()); Files.createFile(path); } - + XMLHandler.save(path, document); } @@ -110,7 +111,7 @@ public class MappingList extends ArrayList<Mapping> { Element rootElement = document.getRootElement(); MappingSerializer mappingSerializer = new MappingSerializer(profile); - mapping = mappingSerializer.loadElement(rootElement); + mapping = mappingSerializer.loadElement(rootElement); mapping.setUuid(UUID.randomUUID()); return mapping; diff --git a/PlayWallCore/src/de/tobias/playpad/action/feedback/ColorAdjuster.java b/PlayWallCore/src/de/tobias/playpad/action/feedback/ColorAdjuster.java index aa16d884026f629d9d80e1e3fd66a9536819f3da..2a5c0b1d83249bdb8321ebe0790b95bc37b49685 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/feedback/ColorAdjuster.java +++ b/PlayWallCore/src/de/tobias/playpad/action/feedback/ColorAdjuster.java @@ -12,9 +12,27 @@ import de.tobias.playpad.pad.Pad; import de.tobias.playpad.project.Project; import de.tobias.playpad.settings.Profile; import javafx.scene.paint.Color; +import javafx.scene.paint.Paint; +/** + * Eine Klasse mit nützlichen Methoden um die Farben bei den Mappern anzupassen. + * + * @author tobias + * + * @since 5.1.0 + * + * @see ColorAdjustable Action muss dieses Interface dafür Implementieren, damit die Farbe Automatisch zum pad gemacht wird. + * @see ColorAssociator Mapper muss dieses Interface implemetieren, damit die entsprechenden Farbe gefunden werden kann + * + */ public class ColorAdjuster { + /** + * Übernimmt die Farben des Pads und den verknüpften Aktionen zu einem Pad auf die Mapper. + * + * @param project + * Aktuelles Projekt. + */ public static void applyColorsToMappers(Project project) { // Apply Layout to Mapper Set<Action> actions = Profile.currentProfile().getMappings().getActiveMapping().getActions(); @@ -32,6 +50,8 @@ public class ColorAdjuster { } } + // COMMENT ColorAdjuster + private static void mapColorForMapper(ColorAdjustable cartAction, Mapper mapper, Project project) { MapperFeedbackable feedbackable = (MapperFeedbackable) mapper; if (feedbackable.supportFeedback() && mapper instanceof ColorAssociator) { @@ -58,14 +78,44 @@ public class ColorAdjuster { } if (layoutStdColor != null) { - DisplayableFeedbackColor associator = Mapper.searchColor(colorAssociator, FeedbackMessage.STANDARD, layoutStdColor); - colorAssociator.setColor(FeedbackMessage.STANDARD, associator.midiVelocity()); + DisplayableFeedbackColor associator = searchColor(colorAssociator, FeedbackMessage.STANDARD, layoutStdColor); + colorAssociator.setColor(FeedbackMessage.STANDARD, associator.mapperFeedbackValue()); } if (layoutEvColor != null) { - DisplayableFeedbackColor associator = Mapper.searchColor(colorAssociator, FeedbackMessage.EVENT, layoutEvColor); - colorAssociator.setColor(FeedbackMessage.EVENT, associator.midiVelocity()); + DisplayableFeedbackColor associator = searchColor(colorAssociator, FeedbackMessage.EVENT, layoutEvColor); + colorAssociator.setColor(FeedbackMessage.EVENT, associator.mapperFeedbackValue()); } } } + + protected static DisplayableFeedbackColor searchColor(ColorAssociator colorAssociator, FeedbackMessage message, Color color) { + DisplayableFeedbackColor minColor = colorAssociator.map(color); + if (minColor != null) { + return minColor; + } + double minVal = 1; + + for (DisplayableFeedbackColor feedbackColor : colorAssociator.getColors()) { + Paint paint = feedbackColor.getPaint(); + if (paint instanceof Color) { + Color c = (Color) paint; + double diff = Math.sqrt(Math.pow(c.getRed() - color.getRed(), 2) + Math.pow(c.getGreen() - color.getGreen(), 2) + + Math.pow(c.getBlue() - color.getBlue(), 2)); + if (minVal > diff) { + minVal = diff; + minColor = feedbackColor; + } + } + } + if (minColor != null && minVal < 0.35) { + return minColor; + } else if (message == FeedbackMessage.STANDARD) { + return colorAssociator.getDefaultStandardColor(); + } else if (message == FeedbackMessage.EVENT) { + return colorAssociator.getDefaultEventColor(); + } else { + return null; + } + } } diff --git a/PlayWallCore/src/de/tobias/playpad/action/feedback/DisplayableFeedbackColor.java b/PlayWallCore/src/de/tobias/playpad/action/feedback/DisplayableFeedbackColor.java index bddd6f7278b1ba8f0a892910fa7c0b5938f2403e..034496deae66bc8587e4e151670b8c11cd0dc0ee 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/feedback/DisplayableFeedbackColor.java +++ b/PlayWallCore/src/de/tobias/playpad/action/feedback/DisplayableFeedbackColor.java @@ -4,6 +4,6 @@ import de.tobias.playpad.DisplayableColor; public interface DisplayableFeedbackColor extends DisplayableColor { - public int midiVelocity(); + public int mapperFeedbackValue(); } diff --git a/PlayWallCore/src/de/tobias/playpad/action/feedback/Feedback.java b/PlayWallCore/src/de/tobias/playpad/action/feedback/Feedback.java index e72c59d59907fae4882aa38e169855d2ef569e19..1ae1aadcc52e7bf29ceafe5769542ece50449a76 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/feedback/Feedback.java +++ b/PlayWallCore/src/de/tobias/playpad/action/feedback/Feedback.java @@ -2,16 +2,63 @@ package de.tobias.playpad.action.feedback; import org.dom4j.Element; +import de.tobias.playpad.action.mapper.Mapper; + +/** + * Das ist die Abstrakte Klasse für ein Feedback. Jedes Mapper Gerät kann eine eigene Klasse dafür entwickeln. Allerdings müssen gibt es ur + * eine beschränkte Anzahl an Typen von Feedbacks. + * + * @author tobias + * + * @since 5.0.0 + * + * @see FeedbackType Type des Feedbacks. Damit wird es im Mapper initalisiert. + * @see Mapper#initFeedback() Damit wird das Feedback initalisiert im Mapper. + */ public abstract class Feedback { + /** + * Gibt den Wert für das Gerät zurück, für eine bestimmte Aktion. + * + * @param message + * Art der Feedback Meldung + * @return Wert für den Mapper + */ public abstract int getValueForFeedbackMessage(FeedbackMessage message); + /** + * Setzt den Wert für eine Feedback Meldung. + * + * @param feedbackMessage + * Art der Feedback Meldung + * @param value + * Wert für den Mapper + */ public abstract void setFeedback(FeedbackMessage feedbackMessage, int value); - public abstract void load(Element root); + /** + * Lädt alle Informationen aus einem XML Objekt. + * + * @param feedbackObject + * XML Object. + */ + public abstract void load(Element feedbackObject); - public abstract void save(Element root); + /** + * Speichert die Informationen des Feedbacks in ein XML Objekt. + * + * @param feedbackObject + * Oberstes Objekt der XML Daten + */ + public abstract void save(Element feedbackObject); - public abstract Feedback cloneFeedback() throws CloneNotSupportedException ; + /** + * Dupliziert ein FeedbackObjeck. + * + * @return Duplikat. + * @throws CloneNotSupportedException + * Clone Fehlerhaft + */ + public abstract Feedback cloneFeedback() throws CloneNotSupportedException; } diff --git a/PlayWallCore/src/de/tobias/playpad/action/feedback/FeedbackMessage.java b/PlayWallCore/src/de/tobias/playpad/action/feedback/FeedbackMessage.java index 6b9ed3ce875153a719f9950b3a64f7f34e3d521e..564019e134cf796f76000fea17106bc843117460 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/feedback/FeedbackMessage.java +++ b/PlayWallCore/src/de/tobias/playpad/action/feedback/FeedbackMessage.java @@ -1,9 +1,30 @@ package de.tobias.playpad.action.feedback; +/** + * Arten von Feedback Meldungen. + * + * @author tobias + * + * @since 5.0.0 + * + * @see Feedback#getValueForFeedbackMessage(FeedbackMessage) + */ public enum FeedbackMessage { + /** + * Feedback Aus. + */ OFF, + /** + * Standart bei keiner Aktion. + */ STANDARD, + /** + * Besondere Aktion. + */ EVENT, + /** + * Wichtiger Hinweis auf dem Mapper. + */ WARNING; } diff --git a/PlayWallCore/src/de/tobias/playpad/action/mapper/Mapper.java b/PlayWallCore/src/de/tobias/playpad/action/mapper/Mapper.java index a64f8af9d6b822ba309a726271e562cabeba0267..2275187d26b014f77fbd61443be4e79b5dbc126b 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/mapper/Mapper.java +++ b/PlayWallCore/src/de/tobias/playpad/action/mapper/Mapper.java @@ -4,63 +4,93 @@ import org.dom4j.Element; import de.tobias.playpad.Displayable; import de.tobias.playpad.action.Action; -import de.tobias.playpad.action.feedback.ColorAssociator; -import de.tobias.playpad.action.feedback.DisplayableFeedbackColor; -import de.tobias.playpad.action.feedback.FeedbackMessage; +import de.tobias.playpad.action.feedback.Feedback; import de.tobias.playpad.action.feedback.FeedbackType; -import javafx.scene.paint.Color; -import javafx.scene.paint.Paint; +/** + * Abstrakte Klasse für das Handling von Mappern. Die Aktionen und Handler werden von der Entsprechenden Aktion verwaltet, die dazu gehört. + * Jeder Mapper muss zu einer Aktion gehören. Zu jedem Mapper gehört auch ein Feedback. Dieses wird mittels Interfaces in der konktreten + * Implementation definiert. Diese abstrakte Klasse verwaltet allerdings nur den Type des Feedbacks. Die eigentloche Implementierung des + * Feedbacks ist Aufgabe des konkreten Mappers. + * + * @author tobias + * + * @since 5.0.0 + * + * @see Action Aktion, zu der ein Mapper gehört. + * @see Feedback Feedback für ein Mapper. + */ public abstract class Mapper implements Displayable, Cloneable { + /** + * Feedback für diesen Mapper. (Beispiel Feedback für eine Taste an einem MIDI Gerät. + */ protected FeedbackType feedbackType; + /** + * Setzt den FeedbackType des Mappers und initalisiert ihn. + * + * @param feedbackType + * neuer FeedbackType + * + * @see Mapper#initFeedback() wird automatisch aufgerufen. + * + */ + @Deprecated // Referenz auf Action, da Action den FeedbackType schon hat public void setFeedbackType(FeedbackType feedbackType) { this.feedbackType = feedbackType; initFeedback(); } + /** + * Gibt den FeedbackType für den entsprechenden Mapper zurück. + * + * @return FeedbackType für den Mapper. + */ + @Deprecated public FeedbackType getFeedbackType() { return feedbackType; } - public abstract String getType(); + /** + * Muss die entsprechende Implementierung des Feedbacks, sofern überhaupt benütigt initialisieren. Standart Implementierung ist leer, da + * optionale Methode. + */ + public void initFeedback() { + + } - protected abstract void initFeedback(); + /** + * ID des Mappers. + * + * @return IDs + */ + public abstract String getType(); + /** + * Deserialisierung der Daten + * + * @param element + * XML Element + * @param action + * Zugehörige Action + */ public abstract void load(Element element, Action action); - public abstract void save(Element element, Action action); + /** + * Speichert die Einstellungen eines Mappers. + * + * @param element + * Oberstes Objekt der XML Daten + */ + public abstract void save(Element element); + /** + * Dupliziert ein Mapper Objekt. + * + * @return Duplikat. + * @throws CloneNotSupportedException Clone Fehlgeschlagen + */ public abstract Mapper cloneMapper() throws CloneNotSupportedException; - public static DisplayableFeedbackColor searchColor(ColorAssociator colorAssociator, FeedbackMessage message, Color color) { - DisplayableFeedbackColor minColor = colorAssociator.map(color); - if (minColor != null) { - return minColor; - } - double minVal = 1; - - for (DisplayableFeedbackColor feedbackColor : colorAssociator.getColors()) { - Paint paint = feedbackColor.getPaint(); - if (paint instanceof Color) { - Color c = (Color) paint; - double diff = Math.sqrt(Math.pow(c.getRed() - color.getRed(), 2) + Math.pow(c.getGreen() - color.getGreen(), 2) - + Math.pow(c.getBlue() - color.getBlue(), 2)); - if (minVal > diff) { - minVal = diff; - minColor = feedbackColor; - } - } - } - if (minColor != null && minVal < 0.35) { - return minColor; - } else if (message == FeedbackMessage.STANDARD) { - return colorAssociator.getDefaultStandardColor(); - } else if (message == FeedbackMessage.EVENT) { - return colorAssociator.getDefaultEventColor(); - } else { - return null; - } - } } diff --git a/PlayWallCore/src/de/tobias/playpad/action/MapperSerializer.java b/PlayWallCore/src/de/tobias/playpad/action/mapper/MapperSerializer.java similarity index 83% rename from PlayWallCore/src/de/tobias/playpad/action/MapperSerializer.java rename to PlayWallCore/src/de/tobias/playpad/action/mapper/MapperSerializer.java index 20a03215f352e2cb38fc4fe31760237af3645e0d..604f33b3ddc14c39556638c315fc02d8d51d9cff 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/MapperSerializer.java +++ b/PlayWallCore/src/de/tobias/playpad/action/mapper/MapperSerializer.java @@ -1,14 +1,20 @@ -package de.tobias.playpad.action; +package de.tobias.playpad.action.mapper; import org.dom4j.Element; import de.tobias.playpad.PlayPadPlugin; -import de.tobias.playpad.action.mapper.Mapper; -import de.tobias.playpad.action.mapper.MapperConnect; +import de.tobias.playpad.action.Action; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.xml.XMLDeserializer; import de.tobias.playpad.xml.XMLSerializer; +/** + * Laden und Speichern von Mappern (Array von Mappern) + * + * @author tobias + * + * @since 5.0.1 + */ public class MapperSerializer implements XMLSerializer<Mapper>, XMLDeserializer<Mapper> { private static final String MAPPER_TYPE = "type"; @@ -18,7 +24,7 @@ public class MapperSerializer implements XMLSerializer<Mapper>, XMLDeserializer< public MapperSerializer(Action action) { this.action = action; } - + @Override public Mapper loadElement(Element element) { String mapperType = element.attributeValue(MAPPER_TYPE); @@ -39,7 +45,7 @@ public class MapperSerializer implements XMLSerializer<Mapper>, XMLDeserializer< @Override public void saveElement(Element newElement, Mapper data) { newElement.addAttribute(MAPPER_TYPE, data.getType()); - data.save(newElement, action); + data.save(newElement); } diff --git a/PlayWallCore/src/de/tobias/playpad/action/mididevice/Device.java b/PlayWallCore/src/de/tobias/playpad/action/mididevice/Device.java index 031fb34af63394bb8ecd75c54952e7a52171812f..e8d46339804f3024b3d0726fa1e8e2981e17f522 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/mididevice/Device.java +++ b/PlayWallCore/src/de/tobias/playpad/action/mididevice/Device.java @@ -17,7 +17,8 @@ import de.tobias.playpad.midi.device.DeviceRegistry; * Erstellen automatisch auf Implementierung. Mögliche Interfaces: DeviceColorAssociatorConnector * * @author tobias - * + * + * @since 5.0.0 */ public abstract class Device extends EventDispatcher implements Listener { diff --git a/PlayWallCore/src/de/tobias/playpad/design/CartDesign.java b/PlayWallCore/src/de/tobias/playpad/design/CartDesign.java index b57416d021acc61c81994cdf9c6f0d0b38fcee05..0e9027f1986d948e18707d25d41882387ee27393 100644 --- a/PlayWallCore/src/de/tobias/playpad/design/CartDesign.java +++ b/PlayWallCore/src/de/tobias/playpad/design/CartDesign.java @@ -19,11 +19,8 @@ public interface CartDesign { */ public void save(Element rootElement); - /** + /* * Wird in einem neuen Thread aufgerufen - * - * @param controller - * @param warning */ public abstract void handleWarning(IPadViewControllerV2 controller, Warning warning, GlobalDesign animate); diff --git a/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java b/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java index a0c101c0ff68b7ce601af7eaedeffbcf4b8b8f53..8936f501e0897706b5e7cb40e41dbc323c4f5b8e 100644 --- a/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java +++ b/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java @@ -47,11 +47,8 @@ public interface GlobalDesign { public double getPadHeight(); - /** + /* * Wird in einem neuen Thread aufgerufen - * - * @param controller - * @param warning */ public void handleWarning(IPadViewControllerV2 controller, Warning warning); diff --git a/PlayWallCore/src/de/tobias/playpad/pad/Pad.java b/PlayWallCore/src/de/tobias/playpad/pad/Pad.java index 5c08543e9c913ffdae33a9f6c1d057b1576ba0ac..585cba77cc83a4e0f146060a574687efa0b85fdd 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/Pad.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/Pad.java @@ -247,7 +247,7 @@ public class Pad { /** * Returns either the fade settings of this pad or the global settings * - * @return + * @return Fade */ public Fade getFade() { if (fadeProperty.isNull().get()) { diff --git a/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java b/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java index ef729afa31783439f1203e54cab389a3b8a016cb..d14022dce4139d09809621c9e1118a88837d1070 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java @@ -60,6 +60,7 @@ public interface IPadViewV2 { */ public void showBusyView(boolean enable); + // COMMENT IPadViewV2 public void pseudoClassState(PseudoClass playCalss, boolean b); public void setStyle(String string); @@ -82,9 +83,21 @@ public interface IPadViewV2 { */ public void setPlaybarVisible(boolean visible); - public void addDefaultButton(Pad pad); + /** + * Fügt die Standart Elemente der PadView hinzu. Die GUI Element sind Abhängig vom Pad, und welchen Content es hat. + * + * @param pad + * Pad + */ + public void addDefaultElement(Pad pad); - public void applyStyleClasses(); + /** + * Fügt die StyleClasses der PadView hinzu. Die Methode wird vom Controller aufgerufen. + */ + public void applyStyleClasses(int index); + /** + * Entfernt die StyleClasses vom PadView. Die Methode wird vom Controller aufgerufen. + */ public void removeStyleClasses(); } diff --git a/PlayWallCore/src/de/tobias/playpad/registry/DefaultRegistry.java b/PlayWallCore/src/de/tobias/playpad/registry/DefaultRegistry.java index 06de75c7b05cc3e23c52dc90b0f48228bb748301..527370af19c653afe363d0f0a21b1666f778404d 100644 --- a/PlayWallCore/src/de/tobias/playpad/registry/DefaultRegistry.java +++ b/PlayWallCore/src/de/tobias/playpad/registry/DefaultRegistry.java @@ -5,7 +5,7 @@ package de.tobias.playpad.registry; * * @author tobias - s0553746 * - * @param <C> + * @param <C> Type der Daten */ public interface DefaultRegistry<C> extends Registry<C> { diff --git a/PlayWallCore/src/de/tobias/playpad/registry/WriteOnlyRegistry.java b/PlayWallCore/src/de/tobias/playpad/registry/WriteOnlyRegistry.java index 1aa3a269564512fc4a5d6f9018a8cde72e6eee73..8a6f8859539d0734ff7b0899f973c38974a5a582 100644 --- a/PlayWallCore/src/de/tobias/playpad/registry/WriteOnlyRegistry.java +++ b/PlayWallCore/src/de/tobias/playpad/registry/WriteOnlyRegistry.java @@ -34,6 +34,8 @@ public interface WriteOnlyRegistry<C> { * * @param url * URL zur Deklaration + * @param loader + * ClassLoader * @throws IOException * Fehler beim Laden der Datei. * @throws DocumentException diff --git a/PlayWallCore/src/de/tobias/playpad/settings/ProfileReference.java b/PlayWallCore/src/de/tobias/playpad/settings/ProfileReference.java index ba3a13d08fed86e8553a404235e11a69e8c57d3b..c50d17723c8fb442c96fb1e6851b753c0eede9cd 100644 --- a/PlayWallCore/src/de/tobias/playpad/settings/ProfileReference.java +++ b/PlayWallCore/src/de/tobias/playpad/settings/ProfileReference.java @@ -103,7 +103,8 @@ public class ProfileReference implements Displayable { * Sucht eine Referenz zu einer UUID raus. * * @param profile - * @return + * UUID des Profiles + * @return ProfileReferenz für die UUID */ public static ProfileReference getReference(UUID profile) { for (ProfileReference ref : profiles) { @@ -128,8 +129,9 @@ public class ProfileReference implements Displayable { * * @param name * Profile Name - * @return + * @return Referenz auf das neue Profile. * @throws UnsupportedEncodingException + * Fehler beim Speichern des XML * @throws IOException * IO Fehler */ @@ -283,7 +285,8 @@ public class ProfileReference implements Displayable { * Gibt einen Pfad für einen Dateinamen in diesem Profile zurück. * * @param name - * @return + * Name der Datei + * @return Path für die Datei */ public Path getCustomFilePath(String name) { return ApplicationUtils.getApplication().getPath(PathType.CONFIGURATION, getFileName(), name); diff --git a/PlayWallCore/src/de/tobias/playpad/tigger/TriggerItem.java b/PlayWallCore/src/de/tobias/playpad/tigger/TriggerItem.java index 9fe601a389ad0a822df722e0a69906367a61fa6e..496a00b4c0d4233db96765c1f5f6f3ec736603c6 100644 --- a/PlayWallCore/src/de/tobias/playpad/tigger/TriggerItem.java +++ b/PlayWallCore/src/de/tobias/playpad/tigger/TriggerItem.java @@ -50,6 +50,7 @@ public abstract class TriggerItem { * You must call super.load * * @param element + * XML Element */ public void load(Element element) { if (element.attributeValue(DURATION_ATTR) != null) { @@ -61,6 +62,7 @@ public abstract class TriggerItem { * You must call super.save * * @param element + * XMl Element */ public void save(Element element) { element.addAttribute(DURATION_ATTR, String.valueOf(durationFromPoint.toMillis())); diff --git a/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutConnect.java b/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutConnect.java index c81e610e5705f7d3411609deb4596da63c176926..2bec2f288326cc45f96bf0d22adfe5ea80a08fbd 100644 --- a/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutConnect.java +++ b/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutConnect.java @@ -31,6 +31,9 @@ public interface MainLayoutConnect { /** * Erstellt einen ViewController für die Menu/Toolbar Fläche. * + * @param mainViewRef + * Refernz auf den Main View + * * @return Neuer ViewController mit View */ public MenuToolbarViewController createMenuToolbar(IMainViewController mainViewRef); diff --git a/PlayWallCore/src/de/tobias/playpad/viewcontroller/IMappingTabViewController.java b/PlayWallCore/src/de/tobias/playpad/viewcontroller/IMappingTabViewController.java index baa8dc1c372ef7510e8cfe506ad82a817df518d7..7c28555f6eb9d68d2b64d94e0c3373589309959f 100644 --- a/PlayWallCore/src/de/tobias/playpad/viewcontroller/IMappingTabViewController.java +++ b/PlayWallCore/src/de/tobias/playpad/viewcontroller/IMappingTabViewController.java @@ -2,7 +2,20 @@ package de.tobias.playpad.viewcontroller; import de.tobias.playpad.action.Action; +/** + * Schnittstelle für den Mapping Tab ViewController. Der Controller hat zwei Bereiche: ActionType (Optional), Action + * + * @author tobias + * + * @since 5.0.0 + */ public interface IMappingTabViewController { + /** + * Zeigt im Action Teil der View die Einstellungen zu einer Action an. + * + * @param action + * Action + */ public void showMapperFor(Action action); } diff --git a/PlayWallCore/src/de/tobias/playpad/viewcontroller/SettingsTabViewController.java b/PlayWallCore/src/de/tobias/playpad/viewcontroller/SettingsTabViewController.java index fba59413967875b1b17a348a546158b8016ceda5..a8b9338e66561e84b099b118c42ef8808b2551ee 100644 --- a/PlayWallCore/src/de/tobias/playpad/viewcontroller/SettingsTabViewController.java +++ b/PlayWallCore/src/de/tobias/playpad/viewcontroller/SettingsTabViewController.java @@ -77,7 +77,7 @@ public abstract class SettingsTabViewController extends ContentViewController { /** * Gibt den Namen für den Tab zurück. * - * @return + * @return Display Name des Tabs. */ public abstract String name(); } diff --git a/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java b/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java index 54550f4df29e6c38bef3cdaf305c28b630becea1..8a31a01cc36a1dd5682a68275f537c9efa33058e 100644 --- a/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java +++ b/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java @@ -135,6 +135,7 @@ public interface IMainViewController extends NotificationHandler { * Setzt das MainLayout des Hauptfensters. * * @param mainLayoutConnect + * Neues Layout */ public void setMainLayout(MainLayoutConnect mainLayoutConnect); diff --git a/PlayWallCore/src/de/tobias/playpad/xml/XMLDeserializer.java b/PlayWallCore/src/de/tobias/playpad/xml/XMLDeserializer.java index b458b2bbbbbe92ee5f73321857d5574db09fb816..44581a3fffa50762840ba748a4a6206a103cc67b 100644 --- a/PlayWallCore/src/de/tobias/playpad/xml/XMLDeserializer.java +++ b/PlayWallCore/src/de/tobias/playpad/xml/XMLDeserializer.java @@ -16,7 +16,8 @@ public interface XMLDeserializer<T> { * Lädt ein Object auf XML Daten. * * @param element - * @return + * XML Objekt + * @return Daten aus dem XML */ public T loadElement(Element element); diff --git a/PlayWallPlugins/launchpadplugin/de/tobias/playpad/launchpadplugin/midi/device/mk2/LaunchPadMK2Color.java b/PlayWallPlugins/launchpadplugin/de/tobias/playpad/launchpadplugin/midi/device/mk2/LaunchPadMK2Color.java index 931b455a19bd03cfa642bad8e1e8acd5b51520aa..71770ee1032927b18827caac8d0a2186f00179f4 100644 --- a/PlayWallPlugins/launchpadplugin/de/tobias/playpad/launchpadplugin/midi/device/mk2/LaunchPadMK2Color.java +++ b/PlayWallPlugins/launchpadplugin/de/tobias/playpad/launchpadplugin/midi/device/mk2/LaunchPadMK2Color.java @@ -64,7 +64,7 @@ public enum LaunchPadMK2Color implements DisplayableFeedbackColor { } @Override - public int midiVelocity() { + public int mapperFeedbackValue() { return midi; } @@ -75,7 +75,7 @@ public enum LaunchPadMK2Color implements DisplayableFeedbackColor { public static DisplayableFeedbackColor valueOf(int id) { for (LaunchPadMK2Color color : values()) { - if (color.midiVelocity() == id) { + if (color.mapperFeedbackValue() == id) { return color; } } diff --git a/PlayWallPlugins/launchpadplugin/de/tobias/playpad/launchpadplugin/midi/device/s/LaunchPadSColor.java b/PlayWallPlugins/launchpadplugin/de/tobias/playpad/launchpadplugin/midi/device/s/LaunchPadSColor.java index 1094ba3119cd89eff93603069c9e8af7a9ef2b24..d6bfb63c4e5cad44d582afc51f5cd791558d6334 100644 --- a/PlayWallPlugins/launchpadplugin/de/tobias/playpad/launchpadplugin/midi/device/s/LaunchPadSColor.java +++ b/PlayWallPlugins/launchpadplugin/de/tobias/playpad/launchpadplugin/midi/device/s/LaunchPadSColor.java @@ -20,7 +20,7 @@ public enum LaunchPadSColor implements DisplayableFeedbackColor { } @Override - public int midiVelocity() { + public int mapperFeedbackValue() { return midi; } @@ -31,7 +31,7 @@ public enum LaunchPadSColor implements DisplayableFeedbackColor { public static DisplayableFeedbackColor valueOf(int id) { for (LaunchPadSColor color : values()) { - if (color.midiVelocity() == id) { + if (color.mapperFeedbackValue() == id) { return color; } }