#include "wx/verify_dcp_dialog.h"
#include "wx/standard_controls.h"
#include "wx/playlist_controls.h"
-#ifdef DCPOMATIC_VARIANT_SWAROOP
-#include "wx/swaroop_controls.h"
-#endif
#include "wx/timer_display.h"
#include "wx/system_information_dialog.h"
#include "wx/player_stress_tester.h"
+#include "wx/verify_dcp_progress_dialog.h"
#include "lib/cross.h"
#include "lib/config.h"
#include "lib/util.h"
#include "lib/server.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 "lib/dcpomatic_log.h"
#include "lib/file_log.h"
#ifdef __WXGTK__
#include <X11/Xlib.h>
#endif
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/algorithm/string.hpp>
#include <iostream>
using std::list;
using std::exception;
using std::vector;
-using boost::shared_ptr;
-using boost::weak_ptr;
+using std::shared_ptr;
+using std::weak_ptr;
using boost::scoped_array;
using boost::optional;
-using boost::dynamic_pointer_cast;
+using std::dynamic_pointer_cast;
using boost::thread;
using boost::bind;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
using dcp::raw_convert;
using namespace dcpomatic;
, _system_information_dialog (0)
, _view_full_screen (0)
, _view_dual_screen (0)
+ , _main_sizer (new wxBoxSizer (wxVERTICAL))
{
dcpomatic_log.reset (new NullLog());
_overall_panel = new wxPanel (this, wxID_ANY);
_viewer.reset (new FilmViewer (_overall_panel));
-#ifdef DCPOMATIC_VARIANT_SWAROOP
- SwaroopControls* sc = new SwaroopControls (_overall_panel, _viewer);
- _controls = sc;
- sc->ResetFilm.connect (bind(&DOMFrame::reset_film_weak, this, _1));
-#else
if (Config::instance()->player_mode() == Config::PLAYER_MODE_DUAL) {
PlaylistControls* pc = new PlaylistControls (_overall_panel, _viewer);
_controls = pc;
} else {
_controls = new StandardControls (_overall_panel, _viewer, false);
}
-#endif
_viewer->set_dcp_decode_reduction (Config::instance()->decode_reduction ());
_viewer->PlaybackPermitted.connect (bind(&DOMFrame::playback_permitted, this));
_viewer->Started.connect (bind(&DOMFrame::playback_started, this, _1));
reset_film ();
UpdateChecker::instance()->StateChanged.connect (boost::bind (&DOMFrame::update_checker_state_changed, this));
-#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 ();
_stress.LoadDCP.connect (boost::bind(&DOMFrame::load_dcp, this, _1));
-
-#ifdef DCPOMATIC_VARIANT_SWAROOP
- sc->check_restart ();
-#endif
- }
-
-#ifdef DCPOMATIC_VARIANT_SWAROOP
- 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
-
void setup_main_sizer (Config::PlayerMode mode)
{
- wxSizer* main_sizer = new wxBoxSizer (wxVERTICAL);
+ _main_sizer->Detach (_viewer->panel());
+ _main_sizer->Detach (_controls);
+ _main_sizer->Detach (_info);
if (mode != Config::PLAYER_MODE_DUAL) {
- main_sizer->Add (_viewer->panel(), 1, wxEXPAND | wxALIGN_CENTER_VERTICAL);
+ _main_sizer->Add (_viewer->panel(), 1, wxEXPAND);
}
- main_sizer->Add (_controls, mode == Config::PLAYER_MODE_DUAL ? 1 : 0, wxEXPAND | wxALL, 6);
- main_sizer->Add (_info, 0, wxEXPAND | wxALL, 6);
- _overall_panel->SetSizer (main_sizer);
+ _main_sizer->Add (_controls, mode == Config::PLAYER_MODE_DUAL ? 1 : 0, wxEXPAND | wxALL, 6);
+ _main_sizer->Add (_info, 0, wxEXPAND | wxALL, 6);
+ _overall_panel->SetSizer (_main_sizer);
_overall_panel->Layout ();
}
bool playback_permitted ()
{
-#ifdef DCPOMATIC_VARIANT_SWAROOP
- if (!MonitorChecker::instance()->ok()) {
- 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;
}
}
}
-#ifdef DCPOMATIC_VARIANT_SWAROOP
- BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
- shared_ptr<FFmpegContent> c = dynamic_pointer_cast<FFmpegContent>(i);
- if (c && !c->kdm_timing_window_valid()) {
- ok = false;
- }
- }
-#endif
-
if (!ok) {
error_dialog (this, _("The KDM does not allow playback of this content at this time."));
}
void playback_stopped (DCPTime time)
{
-#ifdef DCPOMATIC_VARIANT_SWAROOP
- try {
- boost::filesystem::remove (Config::path("position"));
- } catch (...) {
- /* Never mind */
- }
-#endif
-
_controls->log (wxString::Format("playback-stopped %s", time.timecode(_film->video_frame_rate()).c_str()));
}
if (!ok || !report_errors_from_last_job(this)) {
return;
}
-#ifndef DCPOMATIC_VARIANT_SWAROOP
Config::instance()->add_to_player_history (dir);
-#endif
} catch (dcp::ReadError& e) {
error_dialog (this, wxString::Format(_("Could not load a DCP from %s"), std_to_wx(dir.string())), std_to_wx(e.what()));
} catch (DCPError& e) {
optional<int> c = Config::instance()->decode_reduction();
_view_cpl = view->Append(ID_view_cpl, _("CPL"), _cpl_menu);
view->AppendSeparator();
-#ifndef DCPOMATIC_VARIANT_SWAROOP
_view_full_screen = view->AppendCheckItem(ID_view_full_screen, _("Full screen\tF11"));
_view_dual_screen = view->AppendCheckItem(ID_view_dual_screen, _("Dual screen\tShift+F11"));
-#endif
setup_menu ();
view->AppendSeparator();
view->Append(ID_view_closed_captions, _("Closed captions..."));
if (r == wxID_OK) {
DCPOMATIC_ASSERT (_film);
- shared_ptr<DCPContent> dcp = boost::dynamic_pointer_cast<DCPContent>(_film->content().front());
+ shared_ptr<DCPContent> dcp = std::dynamic_pointer_cast<DCPContent>(_film->content().front());
DCPOMATIC_ASSERT (dcp);
dcp->add_ov (wx_to_std(c->GetPath()));
JobManager::instance()->add(shared_ptr<Job>(new ExamineContentJob (_film, dcp)));
if (d->ShowModal() == wxID_OK) {
DCPOMATIC_ASSERT (_film);
-#ifdef DCPOMATIC_VARIANT_SWAROOP
- shared_ptr<FFmpegContent> ffmpeg = boost::dynamic_pointer_cast<FFmpegContent>(_film->content().front());
- if (ffmpeg) {
- try {
- ffmpeg->add_kdm (EncryptedECinemaKDM(dcp::file_to_string(wx_to_std(d->GetPath()), MAX_KDM_SIZE)));
- } catch (exception& e) {
- error_dialog (this, wxString::Format(_("Could not load KDM.")), std_to_wx(e.what()));
- d->Destroy();
- return;
- }
- }
-#endif
- shared_ptr<DCPContent> dcp = boost::dynamic_pointer_cast<DCPContent>(_film->content().front());
-#ifndef DCPOMATIC_VARIANT_SWAROOP
+ shared_ptr<DCPContent> dcp = std::dynamic_pointer_cast<DCPContent>(_film->content().front());
DCPOMATIC_ASSERT (dcp);
-#endif
try {
if (dcp) {
dcp->add_kdm (dcp::EncryptedKDM(dcp::file_to_string(wx_to_std(d->GetPath()), MAX_KDM_SIZE)));
void view_cpl (wxCommandEvent& ev)
{
- shared_ptr<DCPContent> dcp = boost::dynamic_pointer_cast<DCPContent>(_film->content().front());
+ shared_ptr<DCPContent> dcp = std::dynamic_pointer_cast<DCPContent>(_film->content().front());
DCPOMATIC_ASSERT (dcp);
DCPExaminer ex (dcp, true);
int id = ev.GetId() - ID_view_cpl;
dcp->set_cpl ((*i)->id());
dcp->examine (_film, shared_ptr<Job>());
+ _info->triggered_update ();
}
void view_full_screen ()
switch (Config::instance()->image_display()) {
case 0:
_dual_screen->Move (0, 0);
- Move (wxDisplay(0).GetClientArea().GetWidth(), 0);
+ Move (wxDisplay(0U).GetClientArea().GetWidth(), 0);
break;
case 1:
- _dual_screen->Move (wxDisplay(0).GetClientArea().GetWidth(), 0);
+ _dual_screen->Move (wxDisplay(0U).GetClientArea().GetWidth(), 0);
// (0, 0) doesn't seem to work for some strange reason
Move (8, 8);
break;
void tools_verify ()
{
- shared_ptr<DCPContent> dcp = boost::dynamic_pointer_cast<DCPContent>(_film->content().front());
+ shared_ptr<DCPContent> dcp = std::dynamic_pointer_cast<DCPContent>(_film->content().front());
DCPOMATIC_ASSERT (dcp);
- JobManager* jm = JobManager::instance ();
- jm->add (shared_ptr<Job> (new VerifyDCPJob (dcp->directories())));
- bool const ok = display_progress (_("DCP-o-matic Player"), _("Verifying DCP"));
- if (!ok) {
+ shared_ptr<VerifyDCPJob> job (new VerifyDCPJob(dcp->directories()));
+ VerifyDCPProgressDialog* progress = new VerifyDCPProgressDialog(this, _("DCP-o-matic Player"));
+ bool const completed = progress->run (job);
+ progress->Destroy ();
+ if (!completed) {
return;
}
- DCPOMATIC_ASSERT (!jm->get().empty());
- shared_ptr<VerifyDCPJob> last = dynamic_pointer_cast<VerifyDCPJob> (jm->get().back());
- DCPOMATIC_ASSERT (last);
-
- VerifyDCPDialog* d = new VerifyDCPDialog (this, last);
+ VerifyDCPDialog* d = new VerifyDCPDialog (this, job);
d->ShowModal ();
d->Destroy ();
}
shared_ptr<FilmViewer> _viewer;
Controls* _controls;
SystemInformationDialog* _system_information_dialog;
- boost::shared_ptr<Film> _film;
+ std::shared_ptr<Film> _film;
boost::signals2::scoped_connection _config_changed_connection;
boost::signals2::scoped_connection _examine_job_connection;
wxMenuItem* _file_add_ov;
wxMenuItem* _tools_verify;
wxMenuItem* _view_full_screen;
wxMenuItem* _view_dual_screen;
+ wxSizer* _main_sizer;
PlayerStressTester _stress;
};