Skip to content
Snippets Groups Projects
Commit 2cd178e7 authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

#181 - Add option to go to the next playlist item only by manual interaction

parent 4867df72
No related branches found
No related tags found
No related merge requests found
......@@ -29,12 +29,14 @@ public class PlaylistTabViewController extends PadSettingsTabViewController {
@FXML
private CheckBox shuffleCheckbox;
@FXML
private ListView<MediaPath> mediaPathListView;
private CheckBox autoNextCheckbox;
@FXML
private Button addButton;
@FXML
private ListView<MediaPath> mediaPathListView;
@FXML
private Button upButton;
@FXML
......@@ -123,11 +125,13 @@ public class PlaylistTabViewController extends PadSettingsTabViewController {
@Override
public void loadSettings(Pad pad) {
shuffleCheckbox.setSelected((Boolean) pad.getPadSettings().getCustomSettings().getOrDefault(Playlistable.SHUFFLE_SETTINGS_KEY, false));
autoNextCheckbox.setSelected((Boolean) pad.getPadSettings().getCustomSettings().getOrDefault(Playlistable.AUTO_NEXT_SETTINGS_KEY, true));
}
@Override
public void saveSettings(Pad pad) {
pad.getPadSettings().getCustomSettings().put(Playlistable.SHUFFLE_SETTINGS_KEY, shuffleCheckbox.isSelected());
pad.getPadSettings().getCustomSettings().put(Playlistable.AUTO_NEXT_SETTINGS_KEY, autoNextCheckbox.isSelected());
}
@FXML
......
......@@ -139,6 +139,7 @@ padSettings.layout.label.custom=Eigenes Layout:
padSettings.layout.checkbox.custom=Aktiviert
padSettings.playlist.settings.title=Allgemeine Einstellungen
padSettings.playlist.settings.shuffle=Zuf\u00E4llige Wiedergabe
padSettings.playlist.settings.autoNext=N\u00E4chsten Eintrag automatisch starten (Standard)
project.label.details=Projektinformationen:
project.label.name=Name:
project.label.profile=Profil:
......
......@@ -14,6 +14,7 @@
<children>
<Label styleClass="headline" text="%padSettings.playlist.settings.title" />
<CheckBox fx:id="shuffleCheckbox" mnemonicParsing="false" text="%padSettings.playlist.settings.shuffle" />
<CheckBox fx:id="autoNextCheckbox" mnemonicParsing="false" text="%padSettings.playlist.settings.autoNext" />
</children>
<VBox.margin>
<Insets />
......
......@@ -6,6 +6,7 @@ import javafx.beans.property.IntegerProperty;
public interface Playlistable {
String SHUFFLE_SETTINGS_KEY = "shuffle";
String AUTO_NEXT_SETTINGS_KEY = "autoNext";
int getCurrentPlayingMediaIndex();
......
......@@ -120,8 +120,12 @@ class ContentPlayerPadContent(val pad: Pad, val `type`: String) extends PadConte
}
showingLastFrame = false
// Only automatically go to the next playlist item, if auto next is active or
// the item is the last one (next() go into stop state if no item is left)
if (isAutoNext || noFurtherItemsInPlaylist) {
mediaPlayers(getCurrentPlayingMediaIndex).next()
}
}
private def hasPadTriggerInterferingZones(item: LocalPadTrigger): Boolean = {
item.getCarts.stream().anyMatch(id => {
......@@ -295,13 +299,11 @@ class ContentPlayerPadContent(val pad: Pad, val `type`: String) extends PadConte
Custom Settings
*/
def shouldShowLastFrame(): Boolean = {
pad.getPadSettings.getCustomSettings.getOrDefault(ContentPlayerPadContentFactory.lastFrame, false).asInstanceOf[Boolean]
}
def shouldShowLastFrame(): Boolean = pad.getPadSettings.getCustomSettings.getOrDefault(ContentPlayerPadContentFactory.lastFrame, false).asInstanceOf[Boolean]
def isShuffle: Boolean = {
pad.getPadSettings.getCustomSettings.getOrDefault(Playlistable.SHUFFLE_SETTINGS_KEY, false).asInstanceOf[Boolean]
}
def isShuffle: Boolean = pad.getPadSettings.getCustomSettings.getOrDefault(Playlistable.SHUFFLE_SETTINGS_KEY, false).asInstanceOf[Boolean]
def isAutoNext: Boolean = pad.getPadSettings.getCustomSettings.getOrDefault(Playlistable.AUTO_NEXT_SETTINGS_KEY, false).asInstanceOf[Boolean]
def getSelectedZones: Seq[Zone] = {
val zoneConfiguration = Profile.currentProfile().getCustomSettings(ContentPluginMain.zoneConfigurationKey).asInstanceOf[ContentPlayerPluginConfiguration]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment