summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-05-09 01:36:11 +0100
committerCarl Hetherington <cth@carlh.net>2019-05-10 23:43:55 +0100
commit5e2b926c116bbce2800fe3459e5a654101355482 (patch)
tree6aa0c2020368b6c97d4e416ecbf856d38c5c4c1b /src/lib
parent6743eacf57a1209270f4021684425865bb72b00f (diff)
Make video view type configurable.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc15
-rw-r--r--src/lib/config.h14
2 files changed, 29 insertions, 0 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 74f916b21..fdd051662 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -167,6 +167,7 @@ Config::set_defaults ()
_interface_complexity = INTERFACE_SIMPLE;
_player_mode = PLAYER_MODE_WINDOW;
_image_display = 0;
+ _video_view_type = VIDEO_VIEW_SIMPLE;
_respect_kdm_validity_periods = true;
_player_activity_log_file = boost::none;
_player_debug_log_file = boost::none;
@@ -583,6 +584,12 @@ try
}
_image_display = f.optional_number_child<int>("ImageDisplay").get_value_or(0);
+ optional<string> vc = f.optional_string_child("VideoViewType");
+ if (vc && *vc == "opengl") {
+ _video_view_type = VIDEO_VIEW_OPENGL;
+ } else if (vc && *vc == "simple") {
+ _video_view_type = VIDEO_VIEW_SIMPLE;
+ }
_respect_kdm_validity_periods = f.optional_bool_child("RespectKDMValidityPeriods").get_value_or(true);
/* PlayerLogFile is old name */
_player_activity_log_file = f.optional_string_child("PlayerLogFile");
@@ -1014,6 +1021,14 @@ Config::write_config () const
/* [XML] ImageDisplay Screen number to put image on in dual-screen player mode. */
root->add_child("ImageDisplay")->add_child_text(raw_convert<string>(_image_display));
+ switch (_video_view_type) {
+ case VIDEO_VIEW_SIMPLE:
+ root->add_child("VideoViewType")->add_child_text("simple");
+ break;
+ case VIDEO_VIEW_OPENGL:
+ root->add_child("VideoViewType")->add_child_text("opengl");
+ break;
+ }
/* [XML] RespectKDMValidityPeriods 1 to refuse to use KDMs that are out of date, 0 to ignore KDM dates. */
root->add_child("RespectKDMValidityPeriods")->add_child_text(_respect_kdm_validity_periods ? "1" : "0");
if (_player_activity_log_file) {
diff --git a/src/lib/config.h b/src/lib/config.h
index a8427663d..e25cb06da 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -488,6 +488,15 @@ public:
return _image_display;
}
+ enum VideoViewType {
+ VIDEO_VIEW_SIMPLE,
+ VIDEO_VIEW_OPENGL
+ };
+
+ VideoViewType video_view_type () const {
+ return _video_view_type;
+ }
+
bool respect_kdm_validity_periods () const {
return _respect_kdm_validity_periods;
}
@@ -954,6 +963,10 @@ public:
maybe_set (_image_display, n);
}
+ void set_video_view_type (VideoViewType v) {
+ maybe_set (_video_view_type, v);
+ }
+
void set_respect_kdm_validity_periods (bool r) {
maybe_set (_respect_kdm_validity_periods, r);
}
@@ -1260,6 +1273,7 @@ private:
Interface _interface_complexity;
PlayerMode _player_mode;
int _image_display;
+ VideoViewType _video_view_type;
bool _respect_kdm_validity_periods;
/** Log file containing things the player does (e.g. started, stopped, loaded
playlist etc.) Does not contain debugging information.