summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-09-27 17:04:56 +0100
committerCarl Hetherington <cth@carlh.net>2018-09-27 17:04:56 +0100
commit2538ac5a15b56880438018c8ab17d8571fe76812 (patch)
treeedce2625e10f1a995e2e310646324e8afdd5a931 /src/lib
parent3df4d6271a6a660fdce143dcd65467c402e98976 (diff)
Set up new watermark config.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc14
-rw-r--r--src/lib/config.h33
2 files changed, 30 insertions, 17 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index fbf0e3b63..6e06f78e4 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -172,7 +172,9 @@ Config::set_defaults ()
#ifdef DCPOMATIC_VARIANT_SWAROOP
_player_background_image = boost::none;
_kdm_server_url = "http://localhost:8000/{CPL}";
- _player_watermark = boost::none;
+ _player_watermark_theatre = "";
+ _player_watermark_period = 1;
+ _player_watermark_duration = 50;
#endif
_allowed_dcp_frame_rates.clear ();
@@ -517,7 +519,9 @@ try
#ifdef DCPOMATIC_VARIANT_SWAROOP
_player_background_image = f.optional_string_child("PlayerBackgroundImage");
_kdm_server_url = f.optional_string_child("KDMServerURL").get_value_or("http://localhost:8000/{CPL}");
- _player_watermark = f.optional_string_child("PlayerWatermark");
+ _player_watermark_theatre = f.optional_string_child("PlayerWatermarkTheatre").get_value_or("");
+ _player_watermark_period = f.optional_number_child<int>("PlayerWatermarkPeriod").get_value_or(1);
+ _player_watermark_duration = f.optional_number_child<int>("PlayerWatermarkDuration").get_value_or(150);
#endif
/* Replace any cinemas from config.xml with those from the configured file */
@@ -921,9 +925,9 @@ Config::write_config () const
root->add_child("PlayerBackgroundImage")->add_child_text(_player_background_image->string());
}
root->add_child("KDMServerURL")->add_child_text(_kdm_server_url);
- if (_player_watermark) {
- root->add_child("PlayerWatermark")->add_child_text(_player_watermark->string());
- }
+ root->add_child("PlayerWatermarkTheatre")->add_child_text(_player_watermark_theatre);
+ root->add_child("PlayerWatermarkPeriod")->add_child_text(raw_convert<string>(_player_watermark_period));
+ root->add_child("PlayerWatermarkDuration")->add_child_text(raw_convert<string>(_player_watermark_duration));
#endif
try {
diff --git a/src/lib/config.h b/src/lib/config.h
index 80bb48d32..8ddc0367d 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -79,7 +79,6 @@ public:
PLAYER_DCP_DIRECTORY,
#ifdef DCPOMATIC_VARIANT_SWAROOP
PLAYER_BACKGROUND_IMAGE,
- PLAYER_WATERMARK,
#endif
OTHER
};
@@ -503,8 +502,16 @@ public:
return _kdm_server_url;
}
- boost::optional<boost::filesystem::path> player_watermark () const {
- return _player_watermark;
+ std::string player_watermark_theatre () const {
+ return _player_watermark_theatre;
+ }
+
+ int player_watermark_period () const {
+ return _player_watermark_period;
+ }
+
+ int player_watermark_duration () const {
+ return _player_watermark_duration;
}
#endif
@@ -971,16 +978,16 @@ public:
maybe_set (_kdm_server_url, s);
}
- void set_player_watermark (boost::filesystem::path p) {
- maybe_set (_player_watermark, p, PLAYER_WATERMARK);
+ void set_player_watermark_theatre (std::string p) {
+ maybe_set (_player_watermark_theatre, p);
}
- void unset_player_watermark () {
- if (!_player_watermark) {
- return;
- }
- _player_watermark = boost::none;
- changed (PLAYER_WATERMARK);
+ void set_player_watermark_period (int minutes) {
+ maybe_set (_player_watermark_period, minutes);
+ }
+
+ void set_player_watermark_duration (int milliseconds) {
+ maybe_set (_player_watermark_duration, milliseconds);
}
#endif
@@ -1180,7 +1187,9 @@ private:
#ifdef DCPOMATIC_VARIANT_SWAROOP
boost::optional<boost::filesystem::path> _player_background_image;
std::string _kdm_server_url;
- boost::optional<boost::filesystem::path> _player_watermark;
+ std::string _player_watermark_theatre;
+ int _player_watermark_period;
+ int _player_watermark_duration;
#endif
static int const _current_version;