Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
syd711 committed Nov 15, 2024
1 parent 2ec3720 commit 5b67d13
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 27 deletions.
Binary file added documentation/recorder/recorder-dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

public class RecordingScreenOptions {
private String displayName;
private int recordingDuration;
private int initialDelay;
private RecordMode recordMode;
private int recordingDuration = 10;
private int initialDelay = 2;
private RecordMode recordMode = RecordMode.ifMissing;
private boolean enabled = true;
private boolean fps60 = false;
private boolean inGameRecording = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,40 @@ public void initialize(URL url, ResourceBundle resourceBundle) {

super.loadFilterPanel(TableFilterController.class, "scene-tables-overview-filter.fxml");

RecorderSettings settings = client.getPreferenceService().getJsonPreference(PreferenceNames.RECORDER_SETTINGS, RecorderSettings.class);
List<RecordingScreenOptions> options = new ArrayList<>();
List<RecordingScreen> recordingScreens = client.getRecorderService().getRecordingScreens();
for (RecordingScreen recordingScreen : recordingScreens) {
try {
FXMLLoader loader = new FXMLLoader(ScreenRecorderPanelController.class.getResource("screen-recorder-panel.fxml"));
Parent panelRoot = loader.load();
ScreenRecorderPanelController screenPanelController = loader.getController();
screenRecorderPanelControllers.add(screenPanelController);
screenPanelController.setVisible(settings.isEnabled(recordingScreen.getScreen()));
screenPanelController.setData(this, recordingScreen);
recordingOptions.getChildren().add(panelRoot);
}
catch (IOException e) {
LOG.error("failed to load recorder options tab: " + e.getMessage(), e);
}
RecordingScreenOptions recordingScreenOption = settings.getRecordingScreenOption(recordingScreen);
if(recordingScreenOption != null) {
options.add(recordingScreenOption);
}
else {
RecordingScreenOptions opt = new RecordingScreenOptions();
opt.setDisplayName(recordingScreen.getName());
options.add(opt);
}
}
// get only the options that have a valid RecordingScreen and ignore all other ones
settings.setRecordingScreenOptions(options);
client.getPreferenceService().setJsonPreference(PreferenceNames.RECORDER_SETTINGS, settings);


/**
* Configure columns after creating the screen panels, the settings are only initialized then
*/
BaseLoadingColumn.configureColumn(columnDisplayName, (value, model) -> {
Label label = new Label(value.getGameDisplayName());
label.getStyleClass().add("default-text");
Expand Down Expand Up @@ -468,34 +502,12 @@ public void changed(ObservableValue<? extends Boolean> observable, Boolean oldVa
return columnCheckbox;
}, true);


RecorderSettings settings = client.getPreferenceService().getJsonPreference(PreferenceNames.RECORDER_SETTINGS, RecorderSettings.class);
BaseLoadingColumn.configureColumn(columnPlayfield, (value, model) -> createScreenCell(value, model, VPinScreen.PlayField), settings.isEnabled(VPinScreen.PlayField));
BaseLoadingColumn.configureColumn(columnBackglass, (value, model) -> createScreenCell(value, model, VPinScreen.BackGlass), settings.isEnabled(VPinScreen.BackGlass));
BaseLoadingColumn.configureColumn(columnDMD, (value, model) -> createScreenCell(value, model, VPinScreen.DMD), settings.isEnabled(VPinScreen.DMD));
BaseLoadingColumn.configureColumn(columnTopper, (value, model) -> createScreenCell(value, model, VPinScreen.Topper), settings.isEnabled(VPinScreen.Topper));
BaseLoadingColumn.configureColumn(columnFullDMD, (value, model) -> createScreenCell(value, model, VPinScreen.Menu), settings.isEnabled(VPinScreen.Menu));

List<RecordingScreenOptions> options = new ArrayList<>();
List<RecordingScreen> recordingScreens = client.getRecorderService().getRecordingScreens();
for (RecordingScreen recordingScreen : recordingScreens) {
try {
FXMLLoader loader = new FXMLLoader(ScreenRecorderPanelController.class.getResource("screen-recorder-panel.fxml"));
Parent panelRoot = loader.load();
ScreenRecorderPanelController screenPanelController = loader.getController();
screenRecorderPanelControllers.add(screenPanelController);
screenPanelController.setVisible(settings.isEnabled(recordingScreen.getScreen()));
screenPanelController.setData(this, recordingScreen);
recordingOptions.getChildren().add(panelRoot);
}
catch (IOException e) {
LOG.error("failed to load recorder options tab: " + e.getMessage(), e);
}
options.add(settings.getRecordingScreenOption(recordingScreen));
}
// get only the options that have a valid RecordingScreen and ignore all other ones
settings.setRecordingScreenOptions(options);
client.getPreferenceService().setJsonPreference(PreferenceNames.RECORDER_SETTINGS, settings);

screenSizeChangeListener = new ScreenSizeChangeListener();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ public void setData(RecorderController recorderController, RecordingScreen recor
option.setDisplayName(recordingScreen.getScreen().name());
option.setRecordMode(RecordMode.ifMissing);
settings.getRecordingScreenOptions().add(option);

client.getPreferenceService().setJsonPreference(PreferenceNames.RECORDER_SETTINGS, settings);
}

recordModeComboBox.setValue(option.getRecordMode());
Expand Down

0 comments on commit 5b67d13

Please sign in to comment.