_overall_panel = new wxPanel (this, wxID_ANY);
_viewer.reset (new FilmViewer (_overall_panel));
- _controls = new Controls (_overall_panel, _viewer, false, false, false);
+ _controls = new Controls (_overall_panel, _viewer, false);
_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));
Bind (wxEVT_MENU, boost::bind (&DOMFrame::forward_frame, this), ID_forward_frame);
UpdateChecker::instance()->StateChanged.connect (boost::bind (&DOMFrame::update_checker_state_changed, this));
+ _controls->DCPDirectorySelected.connect (boost::bind(&DOMFrame::load_dcp, this, _1));
+ _controls->DCPEjected.connect (boost::bind(&DOMFrame::eject_dcp, this));
setup_screen ();
}
Config::instance()->set_decode_reduction (reduction);
}
+ void eject_dcp ()
+ {
+ _film.reset (new Film (optional<boost::filesystem::path>()));
+ _viewer->set_film (_film);
+ _info->triggered_update ();
+ }
+
void load_dcp (boost::filesystem::path dir)
{
_film.reset (new Film (optional<boost::filesystem::path>()));
return;
}
+ /* The DCP has been examined and loaded */
+
+ optional<boost::filesystem::path> kdm_dir = Config::instance()->player_kdm_directory();
+ if (dcp->needs_kdm() && kdm_dir) {
+ /* Look for a KDM */
+ using namespace boost::filesystem;
+ for (directory_iterator i = directory_iterator(*kdm_dir); i != directory_iterator(); ++i) {
+ if (file_size(i->path()) < MAX_KDM_SIZE) {
+ try {
+ dcp::EncryptedKDM kdm(dcp::file_to_string(i->path()));
+ if (kdm.cpl_id() == dcp->cpl()) {
+ dcp->add_kdm (kdm);
+ dcp->examine (shared_ptr<Job>());
+ }
+ } catch (...) {
+ /* Hey well */
+ }
+ }
+ }
+ }
+
setup_from_dcp (dcp);
if (dcp->three_d()) {
j->Check(!dcp->cpl() || i->id() == *dcp->cpl());
++id;
}
+
+ _controls->log (wxString::Format(_("Load DCP %s"), dir.filename().string().c_str()));
}
private:
void setup_screen ()
{
_controls->Show (_mode != Config::PLAYER_MODE_FULL);
+ _controls->show_extended_player_controls (_mode == Config::PLAYER_MODE_DUAL);
_info->Show (_mode != Config::PLAYER_MODE_FULL);
_overall_panel->SetBackgroundColour (_mode == Config::PLAYER_MODE_FULL ? wxColour(0, 0, 0) : wxNullColour);
ShowFullScreen (_mode == Config::PLAYER_MODE_FULL);