X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic.cc;h=a0dde813ddf4642d8d7845443d3cfda5407c379e;hb=139917b9200bfa336078a00db5bb9a4add30cdcd;hp=c193366312af286b18908724a9f3111438762703;hpb=b19987ae5342602977b265ba9167ec09e433367c;p=dcpomatic.git diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index c19336631..a0dde813d 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2016 Carl Hetherington + Copyright (C) 2012-2017 Carl Hetherington This file is part of DCP-o-matic. @@ -25,7 +25,7 @@ #include "wx/film_viewer.h" #include "wx/film_editor.h" #include "wx/job_manager_view.h" -#include "wx/config_dialog.h" +#include "wx/full_config_dialog.h" #include "wx/wx_util.h" #include "wx/film_name_location_dialog.h" #include "wx/wx_signal_manager.h" @@ -64,8 +64,9 @@ #include "lib/dcpomatic_socket.h" #include "lib/hints.h" #include "lib/dcp_content.h" -#include "lib/ffmpeg_transcoder.h" +#include "lib/ffmpeg_encoder.h" #include "lib/transcode_job.h" +#include "lib/dkdm_wrapper.h" #include #include #include @@ -313,13 +314,22 @@ public: overall_panel->SetSizer (main_sizer); - wxAcceleratorEntry accel[2]; +#ifdef __WXOSX__ + int accelerators = 3; +#else + int accelerators = 2; +#endif + wxAcceleratorEntry* accel = new wxAcceleratorEntry[accelerators]; accel[0].Set (wxACCEL_CTRL, static_cast('A'), ID_add_file); accel[1].Set (wxACCEL_NORMAL, WXK_DELETE, ID_remove); +#ifdef __WXOSX__ + accel[2].Set (wxACCEL_CTRL, static_cast('W'), wxID_EXIT); +#endif Bind (wxEVT_MENU, boost::bind (&ContentPanel::add_file_clicked, _film_editor->content_panel()), ID_add_file); Bind (wxEVT_MENU, boost::bind (&DOMFrame::remove_clicked, this, _1), ID_remove); - wxAcceleratorTable accel_table (2, accel); + wxAcceleratorTable accel_table (accelerators, accel); SetAcceleratorTable (accel_table); + delete[] accel; UpdateChecker::instance()->StateChanged.connect (boost::bind (&DOMFrame::update_checker_state_changed, this)); } @@ -499,7 +509,7 @@ private: void edit_preferences () { if (!_config_dialog) { - _config_dialog = create_config_dialog (); + _config_dialog = create_full_config_dialog (); } _config_dialog->Show (this); } @@ -666,7 +676,7 @@ private: _("You are making a DKDM which is encrypted by a private key held in" "\n\n%s\n\nIt is VITALLY IMPORTANT " "that you BACK UP THIS FILE since if it is lost " - "your DKDMs (and the DCPs they protect) will become useless."), std_to_wx(Config::config_path().string()).data() + "your DKDMs (and the DCPs they protect) will become useless."), std_to_wx(Config::config_file().string()).data() ) ); @@ -690,9 +700,9 @@ private: if (kdm) { if (d->internal ()) { - vector dkdms = Config::instance()->dkdms (); - dkdms.push_back (kdm.get()); - Config::instance()->set_dkdms (dkdms); + shared_ptr dkdms = Config::instance()->dkdms (); + dkdms->add (shared_ptr (new DKDM (kdm.get()))); + Config::instance()->changed (); } else { boost::filesystem::path path = d->directory() / (_film->dcp_name(false) + "_DKDM.xml"); kdm->as_xml (path); @@ -707,8 +717,7 @@ private: ExportDialog* d = new ExportDialog (this); if (d->ShowModal() == wxID_OK) { shared_ptr job (new TranscodeJob (_film)); - shared_ptr tx (new FFmpegTranscoder (_film, job, d->path(), d->format())); - job->set_transcoder (tx); + job->set_encoder (shared_ptr (new FFmpegEncoder (_film, job, d->path(), d->format(), d->mixdown_to_stereo()))); JobManager::instance()->add (job); } d->Destroy (); @@ -747,14 +756,14 @@ private: #ifdef DCPOMATIC_LINUX int r = system ("which nautilus"); if (WEXITSTATUS (r) == 0) { - r = system (string ("nautilus " + _film->directory()->string()).c_str ()); + r = system (String::compose("nautilus \"%1\"", _film->directory()->string()).c_str()); if (WEXITSTATUS (r)) { error_dialog (this, _("Could not show DCP (could not run nautilus)")); } } else { int r = system ("which konqueror"); if (WEXITSTATUS (r) == 0) { - r = system (string ("konqueror " + _film->directory()->string()).c_str ()); + r = system (String::compose ("konqueror \"%1\"", _film->directory()->string()).c_str()); if (WEXITSTATUS (r)) { error_dialog (this, _("Could not show DCP (could not run konqueror)")); } @@ -763,7 +772,7 @@ private: #endif #ifdef DCPOMATIC_OSX - int r = system (string ("open -R " + _film->dir (_film->dcp_name (false)).string ()).c_str ()); + int r = system (String::compose ("open -R \"%1\"", _film->dir (_film->dcp_name(false)).string()).c_str()); if (WEXITSTATUS (r)) { error_dialog (this, _("Could not show DCP")); } @@ -1002,7 +1011,7 @@ private: add_item (jobs_menu, _("Make &KDMs...\tCtrl-K"), ID_jobs_make_kdms, NEEDS_FILM); add_item (jobs_menu, _("Make DKDM for DCP-o-matic..."), ID_jobs_make_self_dkdm, NEEDS_FILM); jobs_menu->AppendSeparator (); - add_item (jobs_menu, _("Export..."), ID_jobs_export, NEEDS_FILM); + add_item (jobs_menu, _("Export...\tCtrl-E"), ID_jobs_export, NEEDS_FILM); jobs_menu->AppendSeparator (); add_item (jobs_menu, _("&Send DCP to TMS"), ID_jobs_send_dcp_to_tms, NEEDS_FILM | NOT_DURING_DCP_CREATION | NEEDS_CPL); add_item (jobs_menu, _("S&how DCP"), ID_jobs_show_dcp, NEEDS_FILM | NOT_DURING_DCP_CREATION | NEEDS_CPL); @@ -1166,6 +1175,7 @@ private: wxInitAllImageHandlers (); Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this)); + Config::Warning.connect (boost::bind (&App::config_warning, this, _1)); wxSplashScreen* splash = 0; try { @@ -1351,6 +1361,11 @@ private: message_dialog (_frame, _("The existing configuration failed to load. Default values will be used instead. These may take a short time to create.")); } + void config_warning (string m) + { + message_dialog (_frame, std_to_wx (m)); + } + DOMFrame* _frame; shared_ptr _timer; string _film_to_load;