#include "lib/job.h"
#include "lib/video_content.h"
#include "lib/subtitle_content.h"
+#include "lib/ratio.h"
#include "wx/wx_signal_manager.h"
#include "wx/wx_util.h"
#include "wx/about_dialog.h"
wxPanel* overall_panel = new wxPanel (this, wxID_ANY);
_viewer = new FilmViewer (overall_panel, false, false);
+ _viewer->set_dcp_decode_reduction (Config::instance()->decode_reduction ());
_info = new PlayerInformation (overall_panel, _viewer);
wxSizer* main_sizer = new wxBoxSizer (wxVERTICAL);
main_sizer->Add (_viewer, 1, wxEXPAND | wxALL, 6);
main_sizer->Add (_info, 0, wxEXPAND | wxALL, 6);
overall_panel->SetSizer (main_sizer);
+#ifdef __WXOSX__
+ wxAcceleratorEntry* accel = new wxAcceleratorEntry[1];
+ accel[0].Set(wxACCEL_CTRL, static_cast<int>('W'), ID_file_close);
+ wxAcceleratorTable accel_table (1, accel);
+ SetAcceleratorTable (accel_table);
+ delete[] accel;
+#endif
+
UpdateChecker::instance()->StateChanged.connect (boost::bind (&DOMFrame::update_checker_state_changed, this));
}
{
_viewer->set_dcp_decode_reduction (reduction);
_info->triggered_update ();
+ Config::instance()->set_decode_reduction (reduction);
}
void load_dcp (boost::filesystem::path dir)
{
_film.reset (new Film (optional<boost::filesystem::path>()));
- shared_ptr<DCPContent> dcp (new DCPContent (_film, dir));
+ shared_ptr<DCPContent> dcp;
+ try {
+ dcp.reset (new DCPContent (_film, dir));
+ } catch (boost::filesystem::filesystem_error& e) {
+ error_dialog (this, _("Could not load DCP"), std_to_wx (e.what()));
+ return;
+ }
+
_film->examine_and_add_content (dcp, true);
JobManager* jm = JobManager::instance ();
shared_ptr<Job> last = jm->get().back();
if (last->finished_in_error()) {
- error_dialog (this, std_to_wx (last->error_summary()) + ".\n");
+ error_dialog(this, std_to_wx(last->error_summary()) + ".\n", std_to_wx(last->error_details()));
return;
}
dcp->subtitle->set_use (true);
}
+ Ratio const * r = Ratio::nearest_from_ratio(dcp->video->size().ratio());
+ if (r) {
+ _film->set_container(r);
+ }
+
_viewer->set_film (_film);
_viewer->set_position (DCPTime ());
_info->triggered_update ();
#endif
wxMenu* view = new wxMenu;
- view->AppendRadioItem (ID_view_scale_appropriate, _("Set decode resolution to match display"));
- view->AppendRadioItem (ID_view_scale_full, _("Decode at full resolution"));
- view->AppendRadioItem (ID_view_scale_half, _("Decode at half resolution"));
- view->AppendRadioItem (ID_view_scale_quarter, _("Decode at quarter resolution"));
+ optional<int> c = Config::instance()->decode_reduction();
+ view->AppendRadioItem(ID_view_scale_appropriate, _("Set decode resolution to match display"))->Check(!static_cast<bool>(c));
+ view->AppendRadioItem(ID_view_scale_full, _("Decode at full resolution"))->Check(c && c.get() == 0);
+ view->AppendRadioItem(ID_view_scale_half, _("Decode at half resolution"))->Check(c && c.get() == 1);
+ view->AppendRadioItem(ID_view_scale_quarter, _("Decode at quarter resolution"))->Check(c && c.get() == 2);
wxMenu* tools = new wxMenu;
tools->Append (ID_tools_check_for_updates, _("Check for updates"));
DCPOMATIC_ASSERT (dcp);
dcp->add_ov (wx_to_std(c->GetPath()));
dcp->examine (shared_ptr<Job>());
+ /* Maybe we just gained some subtitles */
+ if (dcp->subtitle) {
+ dcp->subtitle->set_use (true);
+ }
}
c->Destroy ();