X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic.cc;h=5c32fd487b735ee22200ae4aed35a6b6d5ffee1b;hb=9f294327cb59fce307c3a439f044d79b081376b0;hp=3680e2802dd8d7fb98a34cbcc4f640b828770a05;hpb=c622a06189181a3a6ad356094c9a3cf4e1f5a722;p=dcpomatic.git diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 3680e2802..5c32fd487 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -45,7 +45,8 @@ #include "wx/save_template_dialog.h" #include "wx/templates_dialog.h" #include "wx/nag_dialog.h" -#include "wx/export_dialog.h" +#include "wx/export_subtitles_dialog.h" +#include "wx/export_video_file_dialog.h" #include "wx/paste_dialog.h" #include "wx/focus_manager.h" #include "wx/html_dialog.h" @@ -227,7 +228,8 @@ enum { ID_jobs_make_kdms, ID_jobs_make_dkdms, ID_jobs_make_self_dkdm, - ID_jobs_export, + ID_jobs_export_video_file, + ID_jobs_export_subtitles, ID_jobs_send_dcp_to_tms, ID_jobs_show_dcp, ID_jobs_open_dcp_in_player, @@ -268,6 +270,7 @@ public: , _history_position (0) , _history_separator (0) , _update_news_requested (false) + , _first_shown_called (false) { #if defined(DCPOMATIC_WINDOWS) if (Config::instance()->win32_console ()) { @@ -319,7 +322,8 @@ public: Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_make_dkdms, this), ID_jobs_make_dkdms); Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_make_dcp_batch, this), ID_jobs_make_dcp_batch); Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_make_self_dkdm, this), ID_jobs_make_self_dkdm); - Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_export, this), ID_jobs_export); + Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_export_video_file, this), ID_jobs_export_video_file); + Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_export_subtitles, this), ID_jobs_export_subtitles); Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_send_dcp_to_tms, this), ID_jobs_send_dcp_to_tms); Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_show_dcp, this), ID_jobs_show_dcp); Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_open_dcp_in_player, this), ID_jobs_open_dcp_in_player); @@ -336,6 +340,7 @@ public: Bind (wxEVT_MENU, boost::bind (&DOMFrame::help_report_a_problem, this), ID_help_report_a_problem); Bind (wxEVT_CLOSE_WINDOW, boost::bind (&DOMFrame::close, this, _1)); + Bind (wxEVT_SHOW, boost::bind (&DOMFrame::show, this, _1)); /* Use a panel as the only child of the Frame so that we avoid the dark-grey background on Windows. @@ -490,6 +495,14 @@ public: private: + void show (wxShowEvent& ev) + { + if (ev.IsShown() && !_first_shown_called) { + _film_editor->first_shown (); + _first_shown_called = true; + } + } + void film_message (string m) { message_dialog (this, std_to_wx(m)); @@ -942,9 +955,10 @@ private: d->Destroy (); } - void jobs_export () + + void jobs_export_video_file () { - ExportDialog* d = new ExportDialog (this, _film->isdcf_name(true)); + ExportVideoFileDialog* d = new ExportVideoFileDialog (this, _film->isdcf_name(true)); if (d->ShowModal() == wxID_OK) { if (boost::filesystem::exists(d->path())) { bool ok = confirm_dialog( @@ -959,26 +973,47 @@ private: } shared_ptr job (new TranscodeJob (_film)); - if (d->format() == EXPORT_FORMAT_SUBTITLES_DCP) { - job->set_encoder ( - shared_ptr(new SubtitleEncoder(_film, job, d->path(), d->split_reels())) - ); - } else { - job->set_encoder ( - shared_ptr ( - new FFmpegEncoder (_film, job, d->path(), d->format(), d->mixdown_to_stereo(), d->split_reels(), d->x264_crf() + job->set_encoder ( + shared_ptr ( + new FFmpegEncoder (_film, job, d->path(), d->format(), d->mixdown_to_stereo(), d->split_reels(), d->split_streams(), d->x264_crf() #ifdef DCPOMATIC_VARIANT_SWAROOP - , optional(), optional() + , optional(), optional() #endif - ) ) - ); + ) + ); + JobManager::instance()->add (job); + } + d->Destroy (); + } + + + void jobs_export_subtitles () + { + ExportSubtitlesDialog* d = new ExportSubtitlesDialog (this, _film->isdcf_name(true), _film->interop()); + if (d->ShowModal() == wxID_OK) { + if (boost::filesystem::exists(d->path())) { + bool ok = confirm_dialog( + this, + wxString::Format (_("File %s already exists. Do you want to overwrite it?"), std_to_wx(d->path().string()).data()) + ); + + if (!ok) { + d->Destroy (); + return; + } } + + shared_ptr job (new TranscodeJob (_film)); + job->set_encoder ( + shared_ptr(new SubtitleEncoder(_film, job, d->path(), d->split_reels(), d->include_font())) + ); JobManager::instance()->add (job); } d->Destroy (); } + void jobs_send_dcp_to_tms () { _film->send_dcp_to_tms (); @@ -1311,7 +1346,8 @@ private: add_item (jobs_menu, _("Make &DKDMs...\tCtrl-D"), ID_jobs_make_dkdms, NEEDS_FILM); add_item (jobs_menu, _("Make DKDM for DCP-o-matic..."), ID_jobs_make_self_dkdm, NEEDS_FILM | NEEDS_ENCRYPTION); jobs_menu->AppendSeparator (); - add_item (jobs_menu, _("Export...\tCtrl-E"), ID_jobs_export, NEEDS_FILM); + add_item (jobs_menu, _("Export video file...\tCtrl-E"), ID_jobs_export_video_file, NEEDS_FILM); + add_item (jobs_menu, _("Export subtitles..."), ID_jobs_export_subtitles, 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); @@ -1498,6 +1534,7 @@ private: boost::signals2::scoped_connection _analytics_message_connection; bool _update_news_requested; shared_ptr _clipboard; + bool _first_shown_called; }; static const wxCmdLineEntryDesc command_line_description[] = {