diff --git a/clapper_src/dialogs.js b/clapper_src/dialogs.js index 80cbc7e2..94d698b7 100644 --- a/clapper_src/dialogs.js +++ b/clapper_src/dialogs.js @@ -196,6 +196,10 @@ class ClapperPrefsDialog extends Gtk.Dialog { title: 'Subtitles', widget: Prefs.SubtitlesPage, + }, + { + title: 'Network', + widget: Prefs.NetworkPage, } ] }, diff --git a/clapper_src/playerBase.js b/clapper_src/playerBase.js index d34a24c5..d703ff33 100644 --- a/clapper_src/playerBase.js +++ b/clapper_src/playerBase.js @@ -88,6 +88,7 @@ class ClapperPlayerBase extends GstPlayer.Player 'seeking-mode', 'audio-offset', 'subtitle-offset', + 'play-flags', ]; for(let key of settingsToSet) @@ -256,6 +257,16 @@ class ClapperPlayerBase extends GstPlayer.Player root[action + '_css_class'](brightClass); debug(`${action} brighter sliders`); break; + case 'play-flags': + const initialFlags = this.pipeline.flags; + const settingsFlags = settings.get_int(key); + + if(initialFlags === settingsFlags) + break; + + this.pipeline.flags = settingsFlags; + debug(`changed play flags: ${initialFlags} -> ${settingsFlags}`); + break; default: break; } diff --git a/clapper_src/prefs.js b/clapper_src/prefs.js index e794139c..6e190650 100644 --- a/clapper_src/prefs.js +++ b/clapper_src/prefs.js @@ -1,4 +1,4 @@ -const { GObject, Gtk, Pango } = imports.gi; +const { GObject, Gst, Gtk, Pango } = imports.gi; const Misc = imports.clapper_src.misc; const PrefsBase = imports.clapper_src.prefsBase; @@ -85,6 +85,18 @@ class ClapperSubtitlesPage extends PrefsBase.Grid } }); +var NetworkPage = GObject.registerClass( +class ClapperNetworkPage extends PrefsBase.Grid +{ + _init() + { + super._init(); + + this.addTitle('Client'); + this.addPlayFlagCheckButton('Progressive download buffering', Gst.PlayFlags.DOWNLOAD); + } +}); + var GStreamerPage = GObject.registerClass( class ClapperGStreamerPage extends PrefsBase.Grid { diff --git a/clapper_src/prefsBase.js b/clapper_src/prefsBase.js index baf7c252..bfd18a3e 100644 --- a/clapper_src/prefsBase.js +++ b/clapper_src/prefsBase.js @@ -127,6 +127,17 @@ class ClapperPrefsGrid extends Gtk.Grid return this.addToGrid(widget); } + addPlayFlagCheckButton(text, flag) + { + let checkButton = this.addCheckButton(text); + let playFlags = settings.get_int('play-flags'); + + checkButton.active = ((playFlags & flag) === flag); + checkButton.connect('toggled', this._onPlayFlagToggled.bind(this, flag)); + + return checkButton; + } + addFontButton(text, setting) { let label = this.getLabel(text + ':'); @@ -188,7 +199,9 @@ class ClapperPrefsGrid extends Gtk.Grid let checkButton = new Gtk.CheckButton({ label: text || null, }); - settings.bind(setting, checkButton, 'active', this.flag); + + if(setting) + settings.bind(setting, checkButton, 'active', this.flag); return checkButton; } @@ -204,6 +217,18 @@ class ClapperPrefsGrid extends Gtk.Grid return fontButton; } + _onPlayFlagToggled(flag, button) + { + let playFlags = settings.get_int('play-flags'); + + if(button.active) + playFlags |= flag; + else + playFlags &= ~flag; + + settings.set_int('play-flags', playFlags); + } + _onClose(name) { if(name) diff --git a/data/com.github.rafostar.Clapper.gschema.xml b/data/com.github.rafostar.Clapper.gschema.xml index b4df13b3..c18218b1 100644 --- a/data/com.github.rafostar.Clapper.gschema.xml +++ b/data/com.github.rafostar.Clapper.gschema.xml @@ -6,10 +6,6 @@ false Automatically enter fullscreen when first file is loaded - - false - Automatically close the app after playback finishes - "restore" Mode used for startup volume value @@ -18,13 +14,9 @@ 100 Custom initial volume value in percentage after startup - - true - Enable to force the app to use dark theme variant - - - true - Enable to make all sliders/bars brighter + + false + Automatically close the app after playback finishes @@ -58,6 +50,14 @@ + + true + Enable to force the app to use dark theme variant + + + true + Enable to make all sliders/bars brighter + true Enable rendering window shadows (only if theme has them) @@ -68,6 +68,10 @@ '[{"apply":false,"name":"vah264dec","rank":300}]' Custom values for GStreamer plugin ranking + + 1687 + Set PlayFlags for playbin +