Browse Source

code cleanup

pull/24/head
Jannik 4 years ago
parent
commit
96e3d9e3ac
  1. 2
      src/main/java/kellerkinder/HomeFlix/application/MainWindowController.java
  2. 7
      src/main/java/kellerkinder/HomeFlix/player/Player.java
  3. 5
      src/main/java/kellerkinder/HomeFlix/player/PlayerController.java

2
src/main/java/kellerkinder/HomeFlix/application/MainWindowController.java

@ -103,7 +103,7 @@ public class MainWindowController {
@FXML
private AnchorPane mainAnchorPane;
@FXML
private AnchorPane tableModeAnchorPane;

7
src/main/java/kellerkinder/HomeFlix/player/Player.java

@ -31,11 +31,9 @@ import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import kellerkinder.HomeFlix.application.Main;
import kellerkinder.HomeFlix.application.MainWindowController;
import kellerkinder.HomeFlix.datatypes.FilmTabelDataType;
public class Player {
private MainWindowController mainWindowController;
private PlayerController playerController;
private Stage stage;
private AnchorPane pane;
@ -46,7 +44,6 @@ public class Player {
* @param mainWindowController the MainWindowController
*/
public Player(MainWindowController mainWindowController) {
this.mainWindowController = mainWindowController;
try {
FXMLLoader fxmlLoader = new FXMLLoader(ClassLoader.getSystemResource("fxml/PlayerWindow.fxml"));
pane = (AnchorPane) fxmlLoader.load();
@ -73,10 +70,6 @@ public class Player {
e.printStackTrace();
}
}
public void playNewFilm(FilmTabelDataType film) {
playerController.init(mainWindowController, this, film);
}
public Stage getStage() {
return stage;

5
src/main/java/kellerkinder/HomeFlix/player/PlayerController.java

@ -138,7 +138,6 @@ public class PlayerController {
});
// every time the play time changes execute this
// TODO rework autoplay
mediaPlayer.currentTimeProperty().addListener(new ChangeListener<Duration>() {
@Override
public void changed(ObservableValue<? extends Duration> observable, Duration oldValue, Duration newValue) {
@ -152,7 +151,7 @@ public class PlayerController {
FilmTabelDataType nextFilm = mainWCon.getDbController().getNextEpisode(film.getTitle(), (episode + 1));
if (nextFilm != null) {
mediaPlayer.stop();
player.playNewFilm(nextFilm);
init(mainWCon, player, nextFilm);
autoplay = true;
}
} else if ((duration - currentTime) < 100) {
@ -178,7 +177,7 @@ public class PlayerController {
private void initActions() {
player.getScene().addEventFilter(MouseEvent.MOUSE_MOVED, new EventHandler<MouseEvent>() {
// hide controls timer init
// hide controls timer initialization
final Timer timer = new Timer();
TimerTask controlAnimationTask = null; // task to execute save operation
final long delayTime = 1000;

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close