Browse Source

add linear-gradient to top & bottom bar, support start in fullscreen

dev
Jannik 9 months ago
parent
commit
5c4b78436f
Signed by: Seil0 GPG Key ID: E8459F3723C52C24
8 changed files with 70 additions and 65 deletions
  1. +2
    -2
      src/main/java/org/mosad/homeflix/application/Main.java
  2. +11
    -0
      src/main/java/org/mosad/homeflix/application/SettingsView.java
  3. +9
    -0
      src/main/java/org/mosad/homeflix/controller/XMLController.java
  4. +17
    -6
      src/main/java/org/mosad/homeflix/player/PlayerController.java
  5. +24
    -57
      src/main/resources/fxml/PlayerWindow.fxml
  6. +5
    -0
      src/main/resources/fxml/SettingsView.fxml
  7. +1
    -0
      src/main/resources/locals/HomeFlix-Local_de_DE.properties
  8. +1
    -0
      src/main/resources/locals/HomeFlix-Local_en_US.properties

+ 2
- 2
src/main/java/org/mosad/homeflix/application/Main.java View File

@ -44,8 +44,8 @@ public class Main extends Application {
private MainWindowController mainWindowController;
private static XMLController xmlController;
private static Logger LOGGER;
public static final String version = "0.8.90";
public static final String buildNumber = "175";
public static final String version = "0.8.91";
public static final String buildNumber = "177";
public static final String versionName = "nimbly xlr8";
// TODO rename streamURL to mediaURL


+ 11
- 0
src/main/java/org/mosad/homeflix/application/SettingsView.java View File

@ -87,6 +87,7 @@ public class SettingsView {
@FXML private JFXToggleButton autoUpdateToggleBtn;
@FXML private JFXToggleButton autoplayToggleBtn;
@FXML private JFXToggleButton fullscreenToggleBtn;
@FXML private TableView<SourceDataType> sourcesTable;
@FXML private TableColumn<SourceDataType, String> sourceColumn;
@ -109,6 +110,7 @@ public class SettingsView {
autoUpdateToggleBtn.setSelected(XMLController.isAutoUpdate());
autoplayToggleBtn.setSelected(XMLController.isAutoplay());
fullscreenToggleBtn.setSelected(XMLController.isFullscreen());
languageChoisBox.setItems(languages);
branchChoisBox.setItems(branches);
@ -197,6 +199,12 @@ public class SettingsView {
XMLController.setAutoplay(!XMLController.isAutoplay());
xmlController.saveSettings();
}
@FXML
private void fullscreenToggleBtnAction(ActionEvent event) {
XMLController.setFullscreen(!XMLController.isFullscreen());
xmlController.saveSettings();
}
@FXML
private void colorPickerAction(ActionEvent event) {
@ -272,6 +280,8 @@ public class SettingsView {
autoUpdateToggleBtn.setToggleLineColor(Color.valueOf(XMLController.getColor()));
autoplayToggleBtn.setToggleColor(Color.valueOf(XMLController.getColor()));
autoplayToggleBtn.setToggleLineColor(Color.valueOf(XMLController.getColor()));
fullscreenToggleBtn.setToggleColor(Color.valueOf(XMLController.getColor()));
fullscreenToggleBtn.setToggleLineColor(Color.valueOf(XMLController.getColor()));
}
public void updateGUILocal() {
@ -288,6 +298,7 @@ public class SettingsView {
autoUpdateToggleBtn.setText(XMLController.getLocalBundle().getString("autoUpdate"));
autoplayToggleBtn.setText(XMLController.getLocalBundle().getString("autoplay"));
fullscreenToggleBtn.setText(XMLController.getLocalBundle().getString("fullscreen"));
}
public void setVisible(boolean visible) {


+ 9
- 0
src/main/java/org/mosad/homeflix/controller/XMLController.java View File

@ -61,6 +61,7 @@ public class XMLController {
private static boolean autoUpdate = false;
private static boolean useBeta = false;
private static boolean autoplay = false;
private static boolean fullscreen = true;
private static double fontSize = 17;
private static ResourceBundle localBundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.US);
@ -276,6 +277,14 @@ public class XMLController {
public static void setAutoplay(boolean autoplay) {
XMLController.autoplay = autoplay;
}
public static boolean isFullscreen() {
return fullscreen;
}
public static void setFullscreen(boolean fullscreen) {
XMLController.fullscreen = fullscreen;
}
public static double getFontSize() {
return fontSize;


+ 17
- 6
src/main/java/org/mosad/homeflix/player/PlayerController.java View File

@ -194,7 +194,7 @@ public class PlayerController {
// hide controls timer initialization
final Timer timer = new Timer();
TimerTask controlAnimationTask = null; // task to execute save operation
final long delayTime = 4000; // hide the controls after 2 seconds
final long delayTime = 3000; // hide the controls after 2 seconds
@Override
public void handle(MouseEvent mouseEvent) {
@ -223,6 +223,11 @@ public class PlayerController {
timer.schedule(controlAnimationTask, delayTime);
}
});
if (XMLController.isFullscreen()) {
player.getStage().setFullScreen(!player.getStage().isFullScreen());
fullscreenIcon.setImage(player.getStage().isFullScreen() ? fullscreenExit : fullscreen);
}
}
/**
@ -283,6 +288,15 @@ public class PlayerController {
@Override
public void handle(MouseEvent event) {
embeddedMediaPlayer.controls().skipTime(skipTime);
// TODO update time-stamps if video is paused
// currentTime = currentTime + skipTime;
// endTime = endTime - skipTime;
//
// Platform.runLater(() -> {
// updateControls();
// });
mousePressed = false;
}
});
@ -437,7 +451,6 @@ public class PlayerController {
setAudioTrack(list.getSelectionModel().getSelectedIndex());
audioPopup.hide();
});
// TODO style the JFXListView
Text heading = new Text("Audio");
heading.setFill(Color.WHITE);
@ -462,13 +475,13 @@ public class PlayerController {
}
@FXML
void btnFullscreenAction(ActionEvent event) {
private void btnFullscreenAction(ActionEvent event) {
player.getStage().setFullScreen(!player.getStage().isFullScreen());
fullscreenIcon.setImage(player.getStage().isFullScreen() ? fullscreenExit : fullscreen);
}
@FXML
void btnNextEpisodeAction(ActionEvent event) {
private void btnNextEpisodeAction(ActionEvent event) {
btnNextEpisode.setVisible(false);
playNextMedia();
}
@ -508,8 +521,6 @@ public class PlayerController {
}
private class FXBufferFormatCallback implements BufferFormatCallback {
int sourceWidth;
int sourceHeight;
@Override
public BufferFormat getBufferFormat(int sourceWidth, int sourceHeight) {


+ 24
- 57
src/main/resources/fxml/PlayerWindow.fxml View File

@ -11,31 +11,20 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane fx:id="panePlayer" prefHeight="720.0"
prefWidth="1280.0" style="-fx-background-color: black;"
xmlns="http://javafx.com/javafx/11.0.1"
xmlns:fx="http://javafx.com/fxml/1">
<AnchorPane fx:id="panePlayer" prefHeight="720.0" prefWidth="1280.0" style="-fx-background-color: black;" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<children>
<HBox alignment="CENTER" AnchorPane.bottomAnchor="0.0"
AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.topAnchor="0.0">
<HBox alignment="CENTER" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<ImageView fx:id="videoImageView" pickOnBounds="true"
preserveRatio="true" />
<ImageView fx:id="videoImageView" pickOnBounds="true" preserveRatio="true" />
</children>
</HBox>
<HBox fx:id="hBoxTop" alignment="CENTER_LEFT" spacing="10.0"
AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.topAnchor="0.0">
<HBox fx:id="hBoxTop" alignment="CENTER_LEFT" spacing="10.0" style="-fx-background-color: linear-gradient(to bottom, #000000aa, #00000000);" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<JFXButton fx:id="btnBack" contentDisplay="GRAPHIC_ONLY"
onAction="#btnBackAction">
<JFXButton fx:id="btnBack" contentDisplay="GRAPHIC_ONLY" onAction="#btnBackAction">
<graphic>
<ImageView fitHeight="24.0" pickOnBounds="true"
preserveRatio="true">
<ImageView fitHeight="24.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image
url="@../icons/baseline_keyboard_backspace_white_48dp.png" />
<Image url="@../icons/baseline_keyboard_backspace_white_48dp.png" />
</image>
</ImageView>
</graphic>
@ -50,9 +39,7 @@
<Insets left="5.0" right="5.0" top="5.0" />
</padding>
</HBox>
<VBox fx:id="bottomVBox" alignment="CENTER"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0">
<VBox fx:id="bottomVBox" alignment="CENTER" style="-fx-background-color: linear-gradient(to top, #000000dd, #00000000);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<children>
<HBox spacing="10.0">
<children>
@ -78,37 +65,29 @@
<children>
<HBox spacing="10.0">
<children>
<JFXButton fx:id="btnPlay"
contentDisplay="GRAPHIC_ONLY" onAction="#btnPlayAction">
<JFXButton fx:id="btnPlay" contentDisplay="GRAPHIC_ONLY" onAction="#btnPlayAction">
<graphic>
<ImageView fx:id="playIcon" fitHeight="42.0"
pickOnBounds="true" preserveRatio="true">
<ImageView fx:id="playIcon" fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/baseline_pause_white_48dp.png" />
</image>
</ImageView>
</graphic>
</JFXButton>
<JFXButton fx:id="btnReplay"
contentDisplay="GRAPHIC_ONLY" onAction="#btnReplayAction">
<JFXButton fx:id="btnReplay" contentDisplay="GRAPHIC_ONLY" onAction="#btnReplayAction">
<graphic>
<ImageView fitHeight="42.0" pickOnBounds="true"
preserveRatio="true">
<ImageView fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image
url="@../icons/baseline_replay_10_white_48dp.png" />
<Image url="@../icons/baseline_replay_10_white_48dp.png" />
</image>
</ImageView>
</graphic>
</JFXButton>
<JFXButton fx:id="btnForward"
contentDisplay="GRAPHIC_ONLY" onAction="#btnForwardAction">
<JFXButton fx:id="btnForward" contentDisplay="GRAPHIC_ONLY" onAction="#btnForwardAction">
<graphic>
<ImageView fitHeight="42.0" pickOnBounds="true"
preserveRatio="true">
<ImageView fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image
url="@../icons/baseline_forward_10_white_48dp.png" />
<Image url="@../icons/baseline_forward_10_white_48dp.png" />
</image>
</ImageView>
</graphic>
@ -118,30 +97,22 @@
<Insets left="5.0" right="5.0" />
</padding>
</HBox>
<HBox alignment="TOP_RIGHT" spacing="10.0"
HBox.hgrow="ALWAYS">
<HBox alignment="TOP_RIGHT" spacing="10.0" HBox.hgrow="ALWAYS">
<children>
<JFXButton fx:id="btnAudio"
contentDisplay="GRAPHIC_ONLY" onAction="#btnAudioAction">
<JFXButton fx:id="btnAudio" contentDisplay="GRAPHIC_ONLY" onAction="#btnAudioAction">
<graphic>
<ImageView fitHeight="42.0" pickOnBounds="true"
preserveRatio="true">
<ImageView fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image
url="@../icons/baseline_subtitles_white_48dp.png" />
<Image url="@../icons/baseline_subtitles_white_48dp.png" />
</image>
</ImageView>
</graphic>
</JFXButton>
<JFXButton fx:id="btnFullscreen"
contentDisplay="GRAPHIC_ONLY" onAction="#btnFullscreenAction"
prefHeight="39.0">
<JFXButton fx:id="btnFullscreen" contentDisplay="GRAPHIC_ONLY" onAction="#btnFullscreenAction" prefHeight="39.0">
<graphic>
<ImageView fx:id="fullscreenIcon" fitHeight="42.0"
pickOnBounds="true" preserveRatio="true">
<ImageView fx:id="fullscreenIcon" fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image
url="@../icons/baseline_fullscreen_white_48dp.png" />
<Image url="@../icons/baseline_fullscreen_white_48dp.png" />
</image>
</ImageView>
</graphic>
@ -161,11 +132,7 @@
<Insets bottom="5.0" />
</padding>
</VBox>
<JFXButton fx:id="btnNextEpisode"
onAction="#btnNextEpisodeAction"
style="-fx-background-color: ee3523;"
text="next episode in 10 seconds" textFill="WHITE" visible="false"
AnchorPane.bottomAnchor="100.0" AnchorPane.rightAnchor="20.0">
<JFXButton fx:id="btnNextEpisode" onAction="#btnNextEpisodeAction" style="-fx-background-color: ee3523;" text="next episode in 10 seconds" textFill="WHITE" visible="false" AnchorPane.bottomAnchor="100.0" AnchorPane.rightAnchor="20.0">
<font>
<Font name="System Bold" size="14.0" />
</font>


+ 5
- 0
src/main/resources/fxml/SettingsView.fxml View File

@ -113,6 +113,11 @@
<Insets bottom="-5.0" top="-5.0" />
</padding>
</JFXToggleButton>
<JFXToggleButton fx:id="fullscreenToggleBtn" onAction="#fullscreenToggleBtnAction" text="start in fullscreen">
<padding>
<Insets bottom="-5.0" top="-5.0" />
</padding>
</JFXToggleButton>
</children>
</VBox>
<VBox spacing="10.0">


+ 1
- 0
src/main/resources/locals/HomeFlix-Local_de_DE.properties View File

@ -40,6 +40,7 @@ updateBtnUpdateAvailable = Update verf\u00FCgbar
updateBtnNoUpdateAvailable = Kein Update verf\u00FCgbar
autoUpdate = beim Start nach Updates suchen:
autoplay = Autoplay
fullscreen = starte im Vollbildmodus
branchLbl = Updatezweig
sourcesLbl = Quellen


+ 1
- 0
src/main/resources/locals/HomeFlix-Local_en_US.properties View File

@ -40,6 +40,7 @@ updateBtnUpdateAvailable = update available
updateBtnNoUpdateAvailable = no update available
autoUpdate = check at startup for updates:
autoplay = Autoplay
fullscreen = start in fullscreen
branchLbl = Branch
sourcesLbl = Sources


Loading…
Cancel
Save