summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc3
-rw-r--r--src/lib/config.h9
-rw-r--r--src/lib/internet.cc1
-rw-r--r--src/lib/internet.h3
4 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index b61b1d054..abb775be8 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -171,6 +171,7 @@ Config::set_defaults ()
_player_kdm_directory = boost::none;
#ifdef DCPOMATIC_VARIANT_SWAROOP
_player_background_image = boost::none;
+ _kdm_server_url = "http://localhost:8000/{CPL}";
#endif
_allowed_dcp_frame_rates.clear ();
@@ -506,6 +507,7 @@ try
_player_kdm_directory = f.optional_string_child("PlayerKDMDirectory");
#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}");
#endif
/* Replace any cinemas from config.xml with those from the configured file */
@@ -908,6 +910,7 @@ Config::write_config () const
if (_player_background_image) {
root->add_child("PlayerBackgroundImage")->add_child_text(_player_background_image->string());
}
+ root->add_child("KDMServerURL")->add_child_text(_kdm_server_url);
#endif
try {
diff --git a/src/lib/config.h b/src/lib/config.h
index 2ebfef84d..378272ff0 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -497,6 +497,10 @@ public:
boost::optional<boost::filesystem::path> player_background_image () const {
return _player_background_image;
}
+
+ std::string kdm_server_url () const {
+ return _kdm_server_url;
+ }
#endif
/* SET (mostly) */
@@ -957,6 +961,10 @@ public:
_player_background_image = boost::none;
changed (PLAYER_BACKGROUND_IMAGE);
}
+
+ void set_kdm_server_url (std::string s) {
+ maybe_set (_kdm_server_url, s);
+ }
#endif
void changed (Property p = OTHER);
@@ -1153,6 +1161,7 @@ private:
boost::optional<boost::filesystem::path> _player_kdm_directory;
#ifdef DCPOMATIC_VARIANT_SWAROOP
boost::optional<boost::filesystem::path> _player_background_image;
+ std::string _kdm_server_url;
#endif
static int const _current_version;
diff --git a/src/lib/internet.cc b/src/lib/internet.cc
index 846dbf7ca..662a82443 100644
--- a/src/lib/internet.cc
+++ b/src/lib/internet.cc
@@ -46,7 +46,6 @@ get_from_url_data (void* buffer, size_t size, size_t nmemb, void* stream)
return fwrite (buffer, size, nmemb, f);
}
-static
optional<string>
get_from_url (string url, bool pasv, ScopedTemporary& temp)
{
diff --git a/src/lib/internet.h b/src/lib/internet.h
index 15746a44a..101eaeae9 100644
--- a/src/lib/internet.h
+++ b/src/lib/internet.h
@@ -22,5 +22,8 @@
#include <boost/function.hpp>
#include <boost/filesystem.hpp>
+class ScopedTemporary;
+
+boost::optional<std::string> get_from_url (std::string url, bool pasv, ScopedTemporary& temp);
boost::optional<std::string> get_from_url (std::string url, bool pasv, boost::function<void (boost::filesystem::path)> load);
boost::optional<std::string> get_from_zip_url (std::string url, std::string file, bool pasv, boost::function<void (boost::filesystem::path)> load);