--- /dev/null
+/*
+ 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 <libxml++/libxml++.h>
+#include <boost/foreach.hpp>
+
+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());
+}
--- /dev/null
+/*
+ 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/>.
+
+*/
+
+#ifndef DCPOMATIC_SPL_H
+#define DCPOMATIC_SPL_H
+
+#include <boost/filesystem.hpp>
+
+class SPLEntry;
+
+class SPL
+{
+public:
+ void as_xml (boost::filesystem::path file) const;
+
+ std::string name;
+ std::list<SPLEntry> playlist;
+};
+
+#endif
*/
+#include "dcpomatic_time.h"
+
namespace dcp {
class CPL;
}
send_problem_report_job.cc
server.cc
shuffler.cc
+ spl.cc
string_log_entry.cc
string_text_file.cc
string_text_file_content.cc
#include "lib/compose.hpp"
#include "lib/dcp_content.h"
#include "lib/job_manager.h"
+#include "lib/spl.h"
+#include "lib/spl_entry.h"
#include "lib/job.h"
#include "lib/film.h"
#include "lib/video_content.h"
{
dcp::DCP dcp (dir);
dcp.read ();
- list<SPLEntry> spl;
+ SPL spl;
BOOST_FOREACH (shared_ptr<dcp::CPL> j, dcp.cpls()) {
- spl.push_back (SPLEntry(j, dir));
+ spl.playlist.push_back (SPLEntry(j, dir));
}
set_spl (spl);
Config::instance()->add_to_player_history (dir);
return optional<dcp::EncryptedKDM>();
}
- void set_spl (list<SPLEntry> spl)
+ void set_spl (SPL spl)
{
if (_viewer->playing ()) {
_viewer->stop ();
_film.reset (new Film (optional<boost::filesystem::path>()));
- if (spl.empty ()) {
+ if (spl.playlist.empty ()) {
_viewer->set_film (_film);
_info->triggered_update ();
return;
DCPTime position = DCPTime::from_frames(1, _film->video_frame_rate());
shared_ptr<DCPContent> first;
- BOOST_FOREACH (SPLEntry i, spl) {
+ BOOST_FOREACH (SPLEntry i, spl.playlist) {
shared_ptr<DCPContent> dcp;
try {
dcp.reset (new DCPContent (_film, i.directory));
_cpl_menu->Remove (*i);
}
- if (spl.size() == 1) {
+ if (spl.playlist.size() == 1) {
/* Offer a CPL menu */
DCPExaminer ex (first);
int id = ID_view_cpl;
#include "lib/job_manager.h"
#include "lib/player_video.h"
#include "lib/dcp_content.h"
+#include "lib/spl_entry.h"
#include <dcp/dcp.h>
#include <dcp/cpl.h>
#include <dcp/reel.h>
{
optional<CPL> sel = selected_cpl ();
DCPOMATIC_ASSERT (sel);
- _spl.push_back (SPLEntry(sel->first, sel->second));
+ _spl.playlist.push_back (SPLEntry(sel->first, sel->second));
add_cpl_to_list (sel->first, _spl_view);
SPLChanged (_spl);
setup_sensitivity ();
{
/* examine content is the only job which stops the viewer working */
bool const active_job = _active_job && *_active_job != "examine_content";
- bool const c = ((_film && !_film->content().empty()) || !_spl.empty()) && !active_job;
+ bool const c = ((_film && !_film->content().empty()) || !_spl.playlist.empty()) && !active_job;
_slider->Enable (c);
_rewind_button->Enable (c);
#include "lib/dcpomatic_time.h"
#include "lib/types.h"
#include "lib/film.h"
-#include "lib/spl_entry.h"
+#include "lib/spl.h"
#include <wx/wx.h>
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
void show_extended_player_controls (bool s);
void log (wxString s);
- boost::signals2::signal<void (std::list<SPLEntry>)> SPLChanged;
+ boost::signals2::signal<void (SPL)> SPLChanged;
private:
void update_position_label ();
wxToggleButton* _play_button;
#endif
boost::optional<std::string> _active_job;
- std::list<SPLEntry> _spl;
+ SPL _spl;
ClosedCaptionsDialog* _closed_captions_dialog;