#include "lib/job_manager.h"
#include "lib/job.h"
#include "lib/film.h"
+#include "lib/null_log.h"
#include "lib/video_content.h"
#include "lib/text_content.h"
#include "lib/ratio.h"
#include "lib/dcpomatic_socket.h"
#include "lib/scoped_temporary.h"
#include "lib/monitor_checker.h"
+#include "lib/lock_file_checker.h"
+#include "lib/ffmpeg_content.h"
#include <dcp/dcp.h>
#include <dcp/raw_convert.h>
#include <dcp/exceptions.h>
, _view_full_screen (0)
, _view_dual_screen (0)
{
+ /* XXX */
+ dcpomatic_log.reset (new NullLog());
+ cout << "here's the log " << dcpomatic_log.get() << "\n";
#if defined(DCPOMATIC_WINDOWS)
maybe_open_console ();
#ifdef DCPOMATIC_VARIANT_SWAROOP
MonitorChecker::instance()->StateChanged.connect(boost::bind(&DOMFrame::monitor_checker_state_changed, this));
MonitorChecker::instance()->run ();
+ LockFileChecker::instance()->StateChanged.connect(boost::bind(&DOMFrame::lock_checker_state_changed, this));
+ LockFileChecker::instance()->run ();
#endif
setup_screen ();
void monitor_checker_state_changed ()
{
if (!MonitorChecker::instance()->ok()) {
+ _viewer->stop ();
error_dialog (this, _("The required display devices are not connected correctly."));
+ }
+ }
+
+ void lock_checker_state_changed ()
+ {
+ if (!LockFileChecker::instance()->ok()) {
_viewer->stop ();
+ error_dialog (this, _("The lock file is not present."));
}
}
#endif
error_dialog (this, _("The required display devices are not connected correctly."));
return false;
}
+ if (!LockFileChecker::instance()->ok()) {
+ error_dialog (this, _("The lock file is not present."));
+ return false;
+ }
#endif
if (!_film || !Config::instance()->respect_kdm_validity_periods()) {
return true;
return;
}
- shared_ptr<DCPContent> dcp = boost::dynamic_pointer_cast<DCPContent>(_film->content().front());
- DCPOMATIC_ASSERT (dcp);
- DCPExaminer ex (dcp);
- shared_ptr<dcp::CPL> playing_cpl;
- BOOST_FOREACH (shared_ptr<dcp::CPL> i, ex.cpls()) {
- if (!dcp->cpl() || i->id() == *dcp->cpl()) {
- playing_cpl = i;
+ FILE* f = fopen_boost(*log, "a");
+
+ /* XXX: this only logs the first piece of content; probably should be each piece? */
+
+ shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(_film->content().front());
+ if (dcp) {
+ DCPExaminer ex (dcp);
+ shared_ptr<dcp::CPL> playing_cpl;
+ BOOST_FOREACH (shared_ptr<dcp::CPL> i, ex.cpls()) {
+ if (!dcp->cpl() || i->id() == *dcp->cpl()) {
+ playing_cpl = i;
+ }
}
+ DCPOMATIC_ASSERT (playing_cpl);
+
+ fprintf (
+ f,
+ "%s playback-started %s %s %s\n",
+ dcp::LocalTime().as_string().c_str(),
+ time.timecode(_film->video_frame_rate()).c_str(),
+ dcp->directories().front().string().c_str(),
+ playing_cpl->annotation_text().c_str()
+ );
+ }
+
+ shared_ptr<FFmpegContent> ffmpeg = dynamic_pointer_cast<FFmpegContent>(_film->content().front());
+ if (ffmpeg) {
+ fprintf (
+ f,
+ "%s playback-started %s %s\n",
+ dcp::LocalTime().as_string().c_str(),
+ time.timecode(_film->video_frame_rate()).c_str(),
+ ffmpeg->path(0).string().c_str()
+ );
}
- DCPOMATIC_ASSERT (playing_cpl)
- FILE* f = fopen_boost(*log, "a");
- fprintf (
- f,
- "%s playback-started %s %s %s\n",
- dcp::LocalTime().as_string().c_str(),
- time.timecode(_film->video_frame_rate()).c_str(),
- dcp->directories().front().string().c_str(),
- playing_cpl->annotation_text().c_str()
- );
fclose (f);
}
reset_film ();
try {
- shared_ptr<DCPContent> dcp (new DCPContent(_film, dir));
+ shared_ptr<DCPContent> dcp (new DCPContent(dir));
_film->examine_and_add_content (dcp);
bool const ok = display_progress (_("DCP-o-matic Player"), _("Loading content"));
if (!ok || !report_errors_from_last_job(this)) {
kdm = get_kdm_from_url (dcp);
#endif
if (!kdm) {
- get_kdm_from_directory (dcp);
+ kdm = get_kdm_from_directory (dcp);
}
if (kdm) {
dcp->add_kdm (*kdm);
- dcp->examine (shared_ptr<Job>());
+ dcp->examine (_film, shared_ptr<Job>());
}
}
DCPOMATIC_ASSERT (dcp);
try {
dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()), MAX_KDM_SIZE)));
- dcp->examine (shared_ptr<Job>());
+ dcp->examine (_film, shared_ptr<Job>());
} catch (exception& e) {
error_dialog (this, wxString::Format (_("Could not load KDM.")), std_to_wx(e.what()));
d->Destroy ();
}
dcp->set_cpl ((*i)->id());
- dcp->examine (shared_ptr<Job>());
+ dcp->examine (_film, shared_ptr<Job>());
}
void view_full_screen ()