From b955937dbc6b00cd0672a54d2b55e13c94ede453 Mon Sep 17 00:00:00 2001 From: James Ball Date: Sun, 9 May 2021 22:27:25 +0100 Subject: [PATCH] Add unused edgeStretch effect --- src/main/java/sh/ball/audio/effect/EventFactory.java | 10 ++++++++++ src/main/java/sh/ball/gui/Controller.java | 4 ---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/sh/ball/audio/effect/EventFactory.java b/src/main/java/sh/ball/audio/effect/EventFactory.java index a8bdbf3c..edc21dba 100644 --- a/src/main/java/sh/ball/audio/effect/EventFactory.java +++ b/src/main/java/sh/ball/audio/effect/EventFactory.java @@ -23,4 +23,14 @@ public class EventFactory { long tmp = Math.round(value); return (double) tmp / factor; } + + public static Effect edgeStretch(double value) { + return (count, v) -> { + if (count % 2 == 0) { + return v.translate(new Vector2(value, 0)); + } else { + return v.translate(new Vector2(-value, 0)); + } + }; + } } diff --git a/src/main/java/sh/ball/gui/Controller.java b/src/main/java/sh/ball/gui/Controller.java index f31b984d..3488e077 100644 --- a/src/main/java/sh/ball/gui/Controller.java +++ b/src/main/java/sh/ball/gui/Controller.java @@ -5,12 +5,10 @@ import sh.ball.audio.AudioPlayer; import sh.ball.audio.effect.Effect; import sh.ball.audio.FrameProducer; -import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URL; -import java.util.EventListener; import java.util.List; import java.util.Map; import java.util.ResourceBundle; @@ -23,8 +21,6 @@ import javafx.fxml.Initializable; import javafx.stage.FileChooser; import javafx.stage.Stage; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException;