summaryrefslogtreecommitdiff
path: root/src/lib/spl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-10-26 00:09:34 +0100
committerCarl Hetherington <cth@carlh.net>2018-10-26 00:09:34 +0100
commitfad8d13cd779a6237feed2c855a46e1a7c66e0ad (patch)
tree22026d4075520a1ad151f0094b90a6b40bcc25b6 /src/lib/spl.cc
parent12e5451c5102c9a3d5b51930503437e0cbf53267 (diff)
Use Film/Playlist for SPL management rather than special classes.
Diffstat (limited to 'src/lib/spl.cc')
-rw-r--r--src/lib/spl.cc62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/lib/spl.cc b/src/lib/spl.cc
deleted file mode 100644
index d7c0944d7..000000000
--- a/src/lib/spl.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
-
- This file is part of DCP-o-matic.
-
- DCP-o-matic is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- DCP-o-matic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#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
-{
- xmlpp::Document doc;
- xmlpp::Element* root = doc.create_root_node ("DCPPlaylist");
- root->set_attribute ("Name", name);
-
- BOOST_FOREACH (SPLEntry i, playlist) {
- xmlpp::Element* d = root->add_child ("DCP");
- d->set_attribute ("CPL", i.cpl->id());
- d->add_child_text (i.directory.string());
- }
-
- doc.write_to_file_formatted(file.string());
-}