diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-10-09 21:57:35 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-10-09 21:57:35 +0100 |
| commit | f598e06928af82fee1d2b25bc4cf25f560478ad4 (patch) | |
| tree | d19de824ecc75ff188e6e0190a519e6edd9c2c64 /src/lib/spl.cc | |
| parent | 71589ebfea5a7adc49f013d405b3158ea612222a (diff) | |
swaroop: restart playback after player crash.
Diffstat (limited to 'src/lib/spl.cc')
| -rw-r--r-- | src/lib/spl.cc | 21 |
1 files changed, 21 insertions, 0 deletions
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 { |
