std::shared_ptr
[dcpomatic.git] / src / tools / dcpomatic.cc
index 5c32fd487b735ee22200ae4aed35a6b6d5ffee1b..386e40cb27389800dc9d6e25182888d3c60c9789 100644 (file)
@@ -50,7 +50,6 @@
 #include "wx/paste_dialog.h"
 #include "wx/focus_manager.h"
 #include "wx/html_dialog.h"
-#include "wx/initial_setup_dialog.h"
 #include "wx/send_i18n_dialog.h"
 #include "wx/i18n_hook.h"
 #include "lib/film.h"
@@ -125,12 +124,15 @@ using std::map;
 using std::make_pair;
 using std::list;
 using std::exception;
-using boost::shared_ptr;
-using boost::dynamic_pointer_cast;
+using std::shared_ptr;
+using std::dynamic_pointer_cast;
 using boost::optional;
 using boost::function;
 using boost::is_any_of;
 using boost::algorithm::find;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 using dcp::raw_convert;
 
 class FilmChangedClosingDialog : public boost::noncopyable
@@ -878,7 +880,11 @@ private:
                _film->write_metadata ();
 
                if (send_to_other_tool (BATCH_JOB_PORT, &start_batch_converter, _film->directory()->string())) {
+#ifdef DCPOMATIC_OSX
+                       error_dialog (this, _("Could not start the batch converter.  You may need to download it from dcpomatic.com."));
+#else
                        error_dialog (this, _("Could not find batch converter."));
+#endif
                }
        }
 
@@ -889,7 +895,11 @@ private:
                }
 
                if (send_to_other_tool (PLAYER_PLAY_PORT, &start_player, _film->dir(_film->dcp_name(false)).string())) {
+#ifdef DCPOMATIC_OSX
+                       error_dialog (this, _("Could not start the player.  You may need to download it from dcpomatic.com."));
+#else
                        error_dialog (this, _("Could not find player."));
+#endif
                }
        }
 
@@ -975,11 +985,7 @@ private:
                        shared_ptr<TranscodeJob> job (new TranscodeJob (_film));
                        job->set_encoder (
                                shared_ptr<FFmpegEncoder> (
-                                       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<dcp::Key>(), optional<string>()
-#endif
-                                               )
+                                       new FFmpegEncoder (_film, job, d->path(), d->format(), d->mixdown_to_stereo(), d->split_reels(), d->split_streams(), d->x264_crf())
                                        )
                                );
                        JobManager::instance()->add (job);
@@ -990,23 +996,11 @@ private:
 
        void jobs_export_subtitles ()
        {
-               ExportSubtitlesDialog* d = new ExportSubtitlesDialog (this, _film->isdcf_name(true), _film->interop());
+               ExportSubtitlesDialog* d = new ExportSubtitlesDialog (this, _film->reels().size(), _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<TranscodeJob> job (new TranscodeJob (_film));
                        job->set_encoder (
-                               shared_ptr<SubtitleEncoder>(new SubtitleEncoder(_film, job, d->path(), d->split_reels(), d->include_font()))
+                               shared_ptr<SubtitleEncoder>(new SubtitleEncoder(_film, job, d->path(), _film->isdcf_name(true), d->split_reels(), d->include_font()))
                                );
                        JobManager::instance()->add (job);
                }
@@ -1515,7 +1509,7 @@ private:
        }
 
        FilmEditor* _film_editor;
-       boost::shared_ptr<FilmViewer> _film_viewer;
+       std::shared_ptr<FilmViewer> _film_viewer;
        StandardControls* _controls;
        VideoWaveformDialog* _video_waveform_dialog;
        SystemInformationDialog* _system_information_dialog;
@@ -1621,13 +1615,6 @@ private:
                        _frame->Maximize ();
                        close_splash ();
 
-                       if (!Config::instance()->nagged(Config::NAG_INITIAL_SETUP)) {
-                               InitialSetupDialog* d = new InitialSetupDialog ();
-                               d->ShowModal ();
-                               d->Destroy ();
-                               Config::instance()->set_nagged(Config::NAG_INITIAL_SETUP, true);
-                       }
-
                        if (running_32_on_64 ()) {
                                NagDialog::maybe_nag (
                                        _frame, Config::NAG_32_ON_64,