summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-10-09 21:57:35 +0100
committerCarl Hetherington <cth@carlh.net>2018-10-09 21:57:35 +0100
commitf598e06928af82fee1d2b25bc4cf25f560478ad4 (patch)
treed19de824ecc75ff188e6e0190a519e6edd9c2c64 /src/lib
parent71589ebfea5a7adc49f013d405b3158ea612222a (diff)
swaroop: restart playback after player crash.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.h2
-rw-r--r--src/lib/dcpomatic_time.h3
-rw-r--r--src/lib/spl.cc21
-rw-r--r--src/lib/spl.h3
4 files changed, 27 insertions, 2 deletions
diff --git a/src/lib/config.h b/src/lib/config.h
index 94690a727..baf446df3 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -1033,13 +1033,13 @@ public:
static void restore_defaults ();
static bool have_existing (std::string);
static boost::filesystem::path config_file ();
+ static boost::filesystem::path path (std::string file, bool create_directories = true);
/** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */
static boost::optional<boost::filesystem::path> override_path;
private:
Config ();
- static boost::filesystem::path path (std::string file, bool create_directories = true);
void read ();
void set_defaults ();
void set_kdm_email_to_default ();
diff --git a/src/lib/dcpomatic_time.h b/src/lib/dcpomatic_time.h
index 3d792467b..c687569ec 100644
--- a/src/lib/dcpomatic_time.h
+++ b/src/lib/dcpomatic_time.h
@@ -221,12 +221,13 @@ public:
return Time<S, O> (INT64_MAX);
}
+ static const int HZ = 96000;
+
private:
friend struct dcpomatic_time_ceil_test;
friend struct dcpomatic_time_floor_test;
Type _t;
- static const int HZ = 96000;
};
class ContentTimeDifferentiator {};
diff --git a/src/lib/spl.cc b/src/lib/spl.cc
index ba99e3028..d7c0944d7 100644
--- a/src/lib/spl.cc
+++ b/src/lib/spl.cc
@@ -21,9 +21,30 @@
#include "spl.h"
#include "spl_entry.h"
#include <dcp/cpl.h>
+#include <dcp/dcp.h>
#include <libxml++/libxml++.h>
#include <boost/foreach.hpp>
+using boost::shared_ptr;
+
+SPL::SPL (boost::filesystem::path file)
+{
+ cxml::Document f ("DCPPlaylist");
+ f.read_file (file);
+
+ name = f.string_attribute ("Name");
+ BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("DCP")) {
+ boost::filesystem::path dir(i->content());
+ dcp::DCP dcp (dir);
+ dcp.read ();
+ BOOST_FOREACH (shared_ptr<dcp::CPL> j, dcp.cpls()) {
+ if (j->id() == i->string_attribute("CPL")) {
+ playlist.push_back (SPLEntry(j, dir));
+ }
+ }
+ }
+}
+
void
SPL::as_xml (boost::filesystem::path file) const
{
diff --git a/src/lib/spl.h b/src/lib/spl.h
index 526016f45..5e1bd47b2 100644
--- a/src/lib/spl.h
+++ b/src/lib/spl.h
@@ -28,6 +28,9 @@ class SPLEntry;
class SPL
{
public:
+ SPL () {}
+ SPL (boost::filesystem::path file);
+
void as_xml (boost::filesystem::path file) const;
std::string name;