WIP commit for moving over image effects to audio effects

pull/88/head
James Ball 2022-06-17 20:03:17 +01:00 zatwierdzone przez James H Ball
rodzic 70d76aa68d
commit 35fa55706a
9 zmienionych plików z 152 dodań i 84 usunięć

Wyświetl plik

@ -3,7 +3,7 @@ package sh.ball.audio.effect;
import sh.ball.shapes.Vector2;
// rotates the vector about (0,0)
public class RotateEffect extends PhaseEffect {
public class RotateEffect extends PhaseEffect implements SettableEffect {
public RotateEffect(int sampleRate, double speed) {
super(sampleRate, speed);
@ -17,4 +17,9 @@ public class RotateEffect extends PhaseEffect {
public Vector2 apply(int count, Vector2 vector) {
return vector.rotate(nextTheta());
}
@Override
public void setValue(double value) {
setSpeed(value);
}
}

Wyświetl plik

@ -4,7 +4,7 @@ import sh.ball.shapes.Vector2;
// Translates the given vector in a sinusoidal fashion if ellipse is true,
// otherwise applies a constant translation
public class TranslateEffect extends PhaseEffect {
public class TranslateEffect extends PhaseEffect implements SettableEffect {
private Vector2 translation;
private boolean ellipse = false;
@ -43,4 +43,9 @@ public class TranslateEffect extends PhaseEffect {
public void setScale(double scale) {
this.scale = scale;
}
@Override
public void setValue(double value) {
setScale(value);
}
}

Wyświetl plik

@ -48,6 +48,11 @@ public class EffectComponentGroup extends HBox {
return controller.effectCheckBox.getText();
}
public void removeCheckBox() {
controller.effectCheckBox.setSelected(true);
controller.effectCheckBox.setVisible(false);
}
public void setType(EffectType type) {
controller.setType(type);
}
@ -110,4 +115,12 @@ public class EffectComponentGroup extends HBox {
public double getIncrement() {
return controller.getIncrement();
}
public void setMajorTickUnit(double tickUnit) {
controller.setMajorTickUnit(tickUnit);
}
public double getMajorTickUnit() {
return controller.getMajorTickUnit();
}
}

Wyświetl plik

@ -208,4 +208,12 @@ public class EffectComponentGroupController implements Initializable, SubControl
public double getIncrement() {
return increment;
}
public void setMajorTickUnit(double tickUnit) {
slider.setMajorTickUnit(tickUnit);
}
public double getMajorTickUnit() {
return slider.getMajorTickUnit();
}
}

Wyświetl plik

@ -19,6 +19,7 @@ import sh.ball.audio.effect.*;
import sh.ball.audio.engine.AudioDevice;
import sh.ball.gui.components.EffectComponentGroup;
import sh.ball.shapes.Shape;
import sh.ball.shapes.Vector2;
import java.net.URL;
import java.util.*;
@ -31,10 +32,10 @@ public class EffectsController implements Initializable, SubController {
private static final int DEFAULT_SAMPLE_RATE = 192000;
private Map<EffectType, Slider> effectTypes;
private final WobbleEffect wobbleEffect;
private final PerspectiveEffect perspectiveEffect;
private final TranslateEffect translateEffect;
private final RotateEffect rotateEffect;
@FXML
private EffectComponentGroup vectorCancelling;
@ -54,10 +55,22 @@ public class EffectsController implements Initializable, SubController {
private EffectComponentGroup traceMin;
@FXML
private EffectComponentGroup perspective;
@FXML
private EffectComponentGroup translationScale;
@FXML
private EffectComponentGroup translationSpeed;
@FXML
private EffectComponentGroup rotateSpeed;
@FXML
private EffectComponentGroup volume;
@FXML
private EffectComponentGroup backingMidi;
public EffectsController() {
this.wobbleEffect = new WobbleEffect(DEFAULT_SAMPLE_RATE);
this.perspectiveEffect = new PerspectiveEffect(DEFAULT_SAMPLE_RATE);
this.translateEffect = new TranslateEffect(DEFAULT_SAMPLE_RATE, 1, new Vector2());
this.rotateEffect = new RotateEffect(DEFAULT_SAMPLE_RATE);
}
private <K, V> Map<K, V> mergeEffectMaps(Function<EffectComponentGroup, Map<K, V>> map) {
@ -77,18 +90,14 @@ public class EffectsController implements Initializable, SubController {
return mergeEffectMaps(effect -> effect.controller.getComboBoxAnimatorMap());
}
// Maps EffectTypes to the slider that controls the effect so that they can be
// toggled when the appropriate checkbox is ticked.
private void initializeEffectTypes() {
effectTypes = mergeEffectMaps(effect -> effect.controller.getEffectSliderMap());
}
// selects or deselects the given audio effect
public void updateEffect(EffectType type, boolean checked, SettableEffect effect, double value) {
if (checked) {
audioPlayer.addEffect(type, effect);
} else {
audioPlayer.removeEffect(type);
if (type != null) {
if (checked) {
audioPlayer.addEffect(type, effect);
} else {
audioPlayer.removeEffect(type);
}
}
}
@ -120,8 +129,6 @@ public class EffectsController implements Initializable, SubController {
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
initializeEffectTypes();
wobble.controller.setAnimator(new EffectAnimator(DEFAULT_SAMPLE_RATE, wobbleEffect));
perspective.controller.setAnimator(new EffectAnimator(DEFAULT_SAMPLE_RATE, perspectiveEffect));
traceMin.controller.setAnimator(new EffectAnimator(DEFAULT_SAMPLE_RATE, new ConsumerEffect(audioPlayer::setTraceMin)));
@ -131,30 +138,56 @@ public class EffectsController implements Initializable, SubController {
smoothing.controller.setAnimator(new EffectAnimator(DEFAULT_SAMPLE_RATE, new SmoothEffect(1)));
verticalDistort.controller.setAnimator(new EffectAnimator(DEFAULT_SAMPLE_RATE, new VerticalDistortEffect(0.2)));
horizontalDistort.controller.setAnimator(new EffectAnimator(DEFAULT_SAMPLE_RATE, new HorizontalDistortEffect(0.2)));
translationScale.controller.setAnimator(new EffectAnimator(DEFAULT_SAMPLE_RATE, translateEffect));
translationSpeed.controller.setAnimator(new EffectAnimator(DEFAULT_SAMPLE_RATE, new ConsumerEffect(translateEffect::setSpeed)));
rotateSpeed.controller.setAnimator(new EffectAnimator(DEFAULT_SAMPLE_RATE, rotateEffect));
volume.controller.setAnimator(new EffectAnimator(DEFAULT_SAMPLE_RATE, new ConsumerEffect((value) -> audioPlayer.setVolume(value / 3.0))));
backingMidi.controller.setAnimator(new EffectAnimator(DEFAULT_SAMPLE_RATE, new ConsumerEffect(audioPlayer::setBackingMidiVolume)));
effects().forEach(effect -> {
effect.controller.setEffectUpdater(this::updateEffect);
// specific functionality for some effects
switch (effect.getType()) {
case WOBBLE -> effect.controller.onToggle((animator, value, selected) -> wobbleEffect.update());
case TRACE_MIN, TRACE_MAX -> effect.controller.onToggle((animator, value, selected) -> {
if (selected) {
animator.setValue(value);
} else if (effect.getType().equals(EffectType.TRACE_MAX)) {
animator.setValue(1.0);
} else {
animator.setValue(0.0);
}
});
if (effect.getType() != null) {
// specific functionality for some effects
switch (effect.getType()) {
case WOBBLE -> effect.controller.onToggle((animator, value, selected) -> wobbleEffect.update());
case TRACE_MIN, TRACE_MAX -> effect.controller.onToggle((animator, value, selected) -> {
if (selected) {
animator.setValue(value);
} else if (effect.getType().equals(EffectType.TRACE_MAX)) {
animator.setValue(1.0);
} else {
animator.setValue(0.0);
}
});
}
}
effect.controller.lateInitialize();
if (effect.getType() == null) {
effect.removeCheckBox();
}
});
}
private List<EffectComponentGroup> effects() {
return List.of(vectorCancelling, bitCrush, verticalDistort, horizontalDistort, wobble, smoothing, traceMin, traceMax, perspective);
return List.of(
vectorCancelling,
bitCrush,
verticalDistort,
horizontalDistort,
wobble,
smoothing,
traceMin,
traceMax,
perspective,
translationScale,
translationSpeed,
rotateSpeed,
volume,
backingMidi
);
}
@Override

Wyświetl plik

@ -6,22 +6,26 @@
<?import javafx.scene.layout.VBox?>
<?import sh.ball.gui.components.EffectComponentGroup?>
<ScrollPane hbarPolicy="NEVER" prefHeight="381.0" prefWidth="608.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sh.ball.gui.controller.EffectsController">
<ScrollPane hbarPolicy="NEVER" prefHeight="590.0" prefWidth="608.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sh.ball.gui.controller.EffectsController">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="380.0" prefWidth="606.0">
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="588.0" prefWidth="606.0">
<children>
<VBox>
<children>
<EffectComponentGroup fx:id="vectorCancelling" increment="0.005" label="vectorCancelling" max="1.0" min="0.0" name="Vector cancelling" type="VECTOR_CANCELLING" value="0.11111111" />
<EffectComponentGroup fx:id="bitCrush" increment="0.005" label="bitCrush" max="1.0" min="0.0" name="Bit crush" type="BIT_CRUSH" value="0.6666666" />
<EffectComponentGroup fx:id="verticalDistort" increment="0.005" label="verticalDistort" max="1.0" min="0.0" name="Vertical shift" type="VERTICAL_DISTORT" value="0.2" />
<EffectComponentGroup fx:id="horizontalDistort" increment="0.005" label="horizontalDistort" max="1.0" min="0.0" name="Horizontal shift" type="HORIZONTAL_DISTORT" value="0.2" />
<EffectComponentGroup fx:id="wobble" increment="0.005" label="wobble" max="1.0" min="0.0" name="Wobble" type="WOBBLE" value="0.2" />
<EffectComponentGroup fx:id="smoothing" increment="0.005" label="smoothing" max="1.0" min="0.0" name="Smoothing" type="SMOOTH" value="0.125" />
<EffectComponentGroup fx:id="traceMax" increment="0.005" label="traceMax" max="1.0" min="0.0" name="Trace max" type="TRACE_MAX" value="0.5" />
<EffectComponentGroup fx:id="traceMin" increment="0.005" label="traceMin" max="1.0" min="0.0" name="Trace min" type="TRACE_MIN" value="0.5" />
<EffectComponentGroup fx:id="perspective" increment="0.005" label="perspective" max="1.0" min="0.0" name="3D Rotation" type="ROTATE_3D" value="0.5" />
<EffectComponentGroup fx:id="vectorCancelling" increment="0.005" majorTickUnit="0.1" label="vectorCancelling" max="1.0" min="0.0" name="Vector cancelling" type="VECTOR_CANCELLING" value="0.11111111" />
<EffectComponentGroup fx:id="bitCrush" increment="0.005" majorTickUnit="0.1" label="bitCrush" max="1.0" min="0.0" name="Bit crush" type="BIT_CRUSH" value="0.6666666" />
<EffectComponentGroup fx:id="wobble" increment="0.005" majorTickUnit="0.1" label="wobble" max="1.0" min="0.0" name="Wobble" type="WOBBLE" value="0.2" />
<EffectComponentGroup fx:id="smoothing" increment="0.005" majorTickUnit="0.1" label="smoothing" max="1.0" min="0.0" name="Smoothing" type="SMOOTH" value="0.125" />
<EffectComponentGroup fx:id="traceMax" increment="0.005" majorTickUnit="0.1" label="traceMax" max="1.0" min="0.0" name="Trace max" type="TRACE_MAX" value="0.5" />
<EffectComponentGroup fx:id="traceMin" increment="0.005" majorTickUnit="0.1" label="traceMin" max="1.0" min="0.0" name="Trace min" type="TRACE_MIN" value="0.5" />
<EffectComponentGroup fx:id="perspective" increment="0.005" majorTickUnit="0.1" label="perspective" max="1.0" min="0.0" name="3D Rotation" type="ROTATE_3D" value="0.5" />
<EffectComponentGroup fx:id="verticalDistort" increment="0.005" majorTickUnit="0.1" label="verticalDistort" max="1.0" min="0.0" name="Vertical shift" type="VERTICAL_DISTORT" value="0.2" />
<EffectComponentGroup fx:id="horizontalDistort" increment="0.005" majorTickUnit="0.1" label="horizontalDistort" max="1.0" min="0.0" name="Horizontal shift" type="HORIZONTAL_DISTORT" value="0.2" />
<EffectComponentGroup fx:id="translationScale" increment="0.05" majorTickUnit="1.0" label="translationScale" max="10.0" min="0.0" name="Translation scale" type="TRANSLATE" value="1.0" />
<EffectComponentGroup fx:id="translationSpeed" increment="0.05" majorTickUnit="1.0" label="translationSpeed" max="10.0" min="0.0" name="Translation speed" value="1.0" />
<EffectComponentGroup fx:id="rotateSpeed" increment="0.05" majorTickUnit="1.0" label="rotateSpeed" max="10.0" min="0.0" name="2D Rotate speed" type="ROTATE" value="0.0" />
<EffectComponentGroup fx:id="volume" increment="0.05" majorTickUnit="1.0" label="volume" max="10.0" min="0.0" name="Volume scale" value="3.0" />
<EffectComponentGroup fx:id="backingMidi" increment="0.005" majorTickUnit="0.1" label="backingMidi" max="1.0" min="0.0" name="MIDI volume" value="0.25" />
</children>
<padding>
<Insets top="5.0" />

Wyświetl plik

@ -7,26 +7,26 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.shape.SVGPath?>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="313.0" prefWidth="454.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sh.ball.gui.controller.LuaController">
<Slider fx:id="luaASlider" blockIncrement="0.01" layoutX="106.0" layoutY="16.0" majorTickUnit="0.1" max="1.0" prefHeight="42.0" prefWidth="257.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Label layoutX="54.0" layoutY="16.0" text="Slider a" />
<SVGPath fx:id="luaAMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="370.0" layoutY="13.0" pickOnBounds="true" />
<SVGPath fx:id="luaBMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="370.0" layoutY="62.0" pickOnBounds="true" />
<CheckBox fx:id="luaBMic" layoutX="407.0" layoutY="65.0" mnemonicParsing="false" text="Mic" />
<Button fx:id="resetStepCounterButton" layoutX="175.0" layoutY="262.0" mnemonicParsing="false" text="Reset Step Counter" />
<SVGPath fx:id="luaCMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="370.0" layoutY="111.0" pickOnBounds="true" />
<CheckBox fx:id="luaCMic" layoutX="407.0" layoutY="114.0" mnemonicParsing="false" text="Mic" />
<SVGPath fx:id="luaDMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="370.0" layoutY="159.0" pickOnBounds="true" />
<CheckBox fx:id="luaDMic" layoutX="407.0" layoutY="162.0" mnemonicParsing="false" text="Mic" />
<SVGPath fx:id="luaEMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="370.0" layoutY="206.0" pickOnBounds="true" />
<CheckBox fx:id="luaEMic" layoutX="407.0" layoutY="209.0" mnemonicParsing="false" text="Mic" />
<Label layoutX="54.0" layoutY="65.0" text="Slider b" />
<Label layoutX="54.0" layoutY="114.0" text="Slider c" />
<Label layoutX="53.0" layoutY="162.0" text="Slider d" />
<Label layoutX="54.0" layoutY="209.0" text="Slider e" />
<CheckBox fx:id="luaAMic" layoutX="407.0" layoutY="16.0" mnemonicParsing="false" text="Mic" />
<Slider fx:id="luaBSlider" blockIncrement="0.01" layoutX="106.0" layoutY="65.0" majorTickUnit="0.1" max="1.0" prefHeight="42.0" prefWidth="257.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Slider fx:id="luaCSlider" blockIncrement="0.01" layoutX="106.0" layoutY="114.0" majorTickUnit="0.1" max="1.0" prefHeight="42.0" prefWidth="257.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Slider fx:id="luaDSlider" blockIncrement="0.01" layoutX="106.0" layoutY="162.0" majorTickUnit="0.1" max="1.0" prefHeight="42.0" prefWidth="257.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Slider fx:id="luaESlider" blockIncrement="0.01" layoutX="106.0" layoutY="209.0" majorTickUnit="0.1" max="1.0" prefHeight="42.0" prefWidth="257.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="313.0" prefWidth="378.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sh.ball.gui.controller.LuaController">
<Slider fx:id="luaASlider" blockIncrement="0.01" layoutX="78.0" layoutY="16.0" majorTickUnit="0.1" max="1.0" prefHeight="42.0" prefWidth="190.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Label layoutX="26.0" layoutY="16.0" text="Slider a" />
<SVGPath fx:id="luaAMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="274.0" layoutY="13.0" pickOnBounds="true" />
<SVGPath fx:id="luaBMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="274.0" layoutY="62.0" pickOnBounds="true" />
<CheckBox fx:id="luaBMic" layoutX="311.0" layoutY="65.0" mnemonicParsing="false" text="Mic" />
<Button fx:id="resetStepCounterButton" layoutX="130.0" layoutY="261.0" mnemonicParsing="false" text="Reset Step Counter" />
<SVGPath fx:id="luaCMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="274.0" layoutY="111.0" pickOnBounds="true" />
<CheckBox fx:id="luaCMic" layoutX="311.0" layoutY="114.0" mnemonicParsing="false" text="Mic" />
<SVGPath fx:id="luaDMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="274.0" layoutY="159.0" pickOnBounds="true" />
<CheckBox fx:id="luaDMic" layoutX="311.0" layoutY="162.0" mnemonicParsing="false" text="Mic" />
<SVGPath fx:id="luaEMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="274.0" layoutY="206.0" pickOnBounds="true" />
<CheckBox fx:id="luaEMic" layoutX="311.0" layoutY="209.0" mnemonicParsing="false" text="Mic" />
<Label layoutX="26.0" layoutY="65.0" text="Slider b" />
<Label layoutX="26.0" layoutY="114.0" text="Slider c" />
<Label layoutX="25.0" layoutY="162.0" text="Slider d" />
<Label layoutX="26.0" layoutY="209.0" text="Slider e" />
<CheckBox fx:id="luaAMic" layoutX="311.0" layoutY="16.0" mnemonicParsing="false" text="Mic" />
<Slider fx:id="luaBSlider" blockIncrement="0.01" layoutX="78.0" layoutY="65.0" majorTickUnit="0.1" max="1.0" prefHeight="42.0" prefWidth="190.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Slider fx:id="luaCSlider" blockIncrement="0.01" layoutX="78.0" layoutY="114.0" majorTickUnit="0.1" max="1.0" prefHeight="42.0" prefWidth="190.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Slider fx:id="luaDSlider" blockIncrement="0.01" layoutX="78.0" layoutY="162.0" majorTickUnit="0.1" max="1.0" prefHeight="42.0" prefWidth="190.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Slider fx:id="luaESlider" blockIncrement="0.01" layoutX="78.0" layoutY="209.0" majorTickUnit="0.1" max="1.0" prefHeight="42.0" prefWidth="190.0" showTickLabels="true" showTickMarks="true" value="1.0" />
</AnchorPane>

Wyświetl plik

@ -217,7 +217,7 @@
<TitledPane animated="false" collapsible="false" layoutX="392.0" layoutY="33.0" prefHeight="371.0" prefWidth="610.0" text="Audio Effects">
<fx:include fx:id="effects" source="effects.fxml" />
</TitledPane>
<TitledPane fx:id="objTitledPane" animated="false" collapsible="false" layoutX="7.0" layoutY="411.0" prefHeight="334.0" prefWidth="464.0" text="3D .obj file settings">
<TitledPane fx:id="objTitledPane" animated="false" collapsible="false" layoutX="7.0" layoutY="411.0" prefHeight="334.0" prefWidth="378.0" text="3D .obj file settings">
<fx:include fx:id="obj" source="obj.fxml" />
</TitledPane>
<TitledPane fx:id="luaTitledPane" animated="false" collapsible="false" layoutX="7.0" layoutY="411.0" prefHeight="334.0" prefWidth="464.0" text=".lua file settings" visible="false">

Wyświetl plik

@ -7,26 +7,26 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.shape.SVGPath?>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="313.0" prefWidth="454.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sh.ball.gui.controller.ObjController">
<Slider fx:id="focalLengthSlider" blockIncrement="0.01" layoutX="106.0" layoutY="16.0" majorTickUnit="0.2" max="2.0" min="1.0E-5" prefHeight="42.0" prefWidth="257.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Label layoutX="32.0" layoutY="15.0" text="Focal length" />
<Slider fx:id="objectXRotateSlider" blockIncrement="0.005" layoutX="106.0" layoutY="65.0" majorTickUnit="0.2" max="1.0" min="-1.0" prefHeight="42.0" prefWidth="258.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Label layoutX="52.0" layoutY="65.0" text="Rotate x" />
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="313.0" prefWidth="378.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sh.ball.gui.controller.ObjController">
<Slider fx:id="focalLengthSlider" blockIncrement="0.01" layoutX="99.0" layoutY="16.0" majorTickUnit="0.2" max="2.0" min="1.0E-5" prefHeight="42.0" prefWidth="190.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Label layoutX="24.0" layoutY="15.0" text="Focal length" />
<Slider fx:id="objectXRotateSlider" blockIncrement="0.005" layoutX="99.0" layoutY="65.0" majorTickUnit="0.2" max="1.0" min="-1.0" prefHeight="42.0" prefWidth="190.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Label layoutX="44.0" layoutY="65.0" text="Rotate x" />
<CheckBox fx:id="rotateCheckBox" layoutX="133.0" layoutY="264.0" mnemonicParsing="false" text="Rotate with Mouse (Esc to disable)" />
<SVGPath fx:id="focalLengthMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="370.0" layoutY="13.0" pickOnBounds="true" />
<SVGPath fx:id="objectXRotateMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="370.0" layoutY="62.0" pickOnBounds="true" />
<CheckBox fx:id="objectXRotateMic" layoutX="407.0" layoutY="65.0" mnemonicParsing="false" text="Mic" />
<SVGPath fx:id="focalLengthMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="290.0" layoutY="13.0" pickOnBounds="true" />
<SVGPath fx:id="objectXRotateMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="290.0" layoutY="62.0" pickOnBounds="true" />
<CheckBox fx:id="objectXRotateMic" layoutX="317.0" layoutY="65.0" mnemonicParsing="false" text="Mic" />
<Button fx:id="resetObjectRotationButton" layoutX="16.0" layoutY="260.0" mnemonicParsing="false" text="Reset Rotation" />
<Slider fx:id="objectYRotateSlider" blockIncrement="0.005" layoutX="106.0" layoutY="114.0" majorTickUnit="0.2" max="1.0" min="-1.0" prefHeight="42.0" prefWidth="258.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Label layoutX="52.0" layoutY="114.0" text="Rotate y" />
<SVGPath fx:id="objectYRotateMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="370.0" layoutY="111.0" pickOnBounds="true" />
<CheckBox fx:id="objectYRotateMic" layoutX="407.0" layoutY="114.0" mnemonicParsing="false" text="Mic" />
<Slider fx:id="objectZRotateSlider" blockIncrement="0.005" layoutX="106.0" layoutY="162.0" majorTickUnit="0.2" max="1.0" min="-1.0" prefHeight="42.0" prefWidth="258.0" showTickLabels="true" showTickMarks="true" />
<Label layoutX="52.0" layoutY="162.0" text="Rotate z" />
<SVGPath fx:id="objectZRotateMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="370.0" layoutY="159.0" pickOnBounds="true" />
<CheckBox fx:id="objectZRotateMic" layoutX="407.0" layoutY="162.0" mnemonicParsing="false" text="Mic" />
<Slider fx:id="objectRotateSpeedSlider" blockIncrement="0.005" layoutX="106.0" layoutY="209.0" majorTickUnit="0.2" max="1.0" min="-1.0" prefHeight="42.0" prefWidth="258.0" showTickLabels="true" showTickMarks="true" />
<Label layoutX="9.0" layoutY="209.0" text="3D Rotate speed" />
<SVGPath fx:id="objectRotateSpeedMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="370.0" layoutY="206.0" pickOnBounds="true" />
<CheckBox fx:id="objectRotateSpeedMic" layoutX="407.0" layoutY="209.0" mnemonicParsing="false" text="Mic" />
<Slider fx:id="objectYRotateSlider" blockIncrement="0.005" layoutX="99.0" layoutY="114.0" majorTickUnit="0.2" max="1.0" min="-1.0" prefHeight="42.0" prefWidth="190.0" showTickLabels="true" showTickMarks="true" value="1.0" />
<Label layoutX="44.0" layoutY="114.0" text="Rotate y" />
<SVGPath fx:id="objectYRotateMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="290.0" layoutY="111.0" pickOnBounds="true" />
<CheckBox fx:id="objectYRotateMic" layoutX="317.0" layoutY="114.0" mnemonicParsing="false" text="Mic" />
<Slider fx:id="objectZRotateSlider" blockIncrement="0.005" layoutX="99.0" layoutY="162.0" majorTickUnit="0.2" max="1.0" min="-1.0" prefHeight="42.0" prefWidth="190.0" showTickLabels="true" showTickMarks="true" />
<Label layoutX="44.0" layoutY="162.0" text="Rotate z" />
<SVGPath fx:id="objectZRotateMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="290.0" layoutY="159.0" pickOnBounds="true" />
<CheckBox fx:id="objectZRotateMic" layoutX="317.0" layoutY="162.0" mnemonicParsing="false" text="Mic" />
<Slider fx:id="objectRotateSpeedSlider" blockIncrement="0.005" layoutX="99.0" layoutY="209.0" majorTickUnit="0.2" max="1.0" min="-1.0" prefHeight="42.0" prefWidth="190.0" showTickLabels="true" showTickMarks="true" />
<Label layoutX="19.0" layoutY="209.0" text="Rotate speed" />
<SVGPath fx:id="objectRotateSpeedMidi" content="M20.15 8.26H22V15.74H20.15M13 8.26H18.43C19 8.26 19.3 8.74 19.3 9.3V14.81C19.3 15.5 19 15.74 18.38 15.74H13V11H14.87V13.91H17.5V9.95H13M10.32 8.26H12.14V15.74H10.32M2 8.26H8.55C9.1 8.26 9.41 8.74 9.41 9.3V15.74H7.59V10.15H6.5V15.74H4.87V10.15H3.83V15.74H2Z" fill="WHITE" layoutX="290.0" layoutY="206.0" pickOnBounds="true" />
<CheckBox fx:id="objectRotateSpeedMic" layoutX="317.0" layoutY="209.0" mnemonicParsing="false" text="Mic" />
</AnchorPane>