Skip to content

Commit

Permalink
When recording playfield for PBX/PBY, record them inverted
Browse files Browse the repository at this point in the history
  • Loading branch information
leprinco committed Nov 18, 2024
1 parent 06a9c70 commit 0088b65
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public class FrontendPlayerDisplay {
private int width;
private int height;
private int rotation;
/**
* For pinballX, playfield videos are inverted
* TODO check how much this is redundant with rotation=270
*/
private boolean inverted;

public int getMonitor() {
return monitor;
Expand Down Expand Up @@ -76,6 +81,15 @@ public void setRotation(int rotation) {
this.rotation = rotation;
}

public boolean isInverted() {
return inverted;
}

public void setInverted(boolean inverted) {
this.inverted = inverted;
}


@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -93,4 +107,5 @@ public int hashCode() {
public String toString() {
return name + " [" + x + "/" + y + " - " + width + "x" + height + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ private void createPlayfieldDisplay(INIConfiguration iniConfiguration, List<Fron
player.setScreen(VPinScreen.PlayField);
player.setMonitor(monitor);
player.setRotation(Integer.parseInt(display.getString("Rotate", "0")));
player.setInverted(true);

boolean windowed = display.getBoolean("Windowed", false);
if (windowed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ private void createDisplay(List<FrontendPlayerDisplay> players, Properties displ
String position = display.getProperty(sectionName + ".Position");
String[] positions = StringUtils.split(position, ",");
String rotation = StringUtils.defaultString(display.getProperty(sectionName + ".Rotation"), "0");
if (VPinScreen.PlayField.equals(screen)) {
player.setInverted(true);
}

boolean fullScreen = "1".equals(display.getProperty(sectionName + ".FullScreen"));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.mephisto.vpin.server.recorder;

import de.mephisto.vpin.commons.SystemInfo;
import de.mephisto.vpin.restclient.frontend.VPinScreen;
import de.mephisto.vpin.restclient.recorder.RecordingScreen;
import de.mephisto.vpin.restclient.recorder.RecordingScreenOptions;
import de.mephisto.vpin.restclient.util.SystemCommandExecutor;
Expand Down Expand Up @@ -106,6 +107,10 @@ public RecordingResult record(@NonNull RecordingScreenOptions options) {
commandList.add("25");
commandList.add("-pix_fmt");
commandList.add("yuv420p");
if (VPinScreen.PlayField.equals(recordingScreen.getScreen()) && recordingScreen.getDisplay().isInverted()) {
commandList.add("-vf");
commandList.add("\"transpose=2,transpose=2\"");
}
commandList.add(target.getAbsolutePath());

executor = new SystemCommandExecutor(commandList);
Expand Down

0 comments on commit 0088b65

Please sign in to comment.