Cleanup: extract some stuff to a method in CreateCLI.
[dcpomatic.git] / src / tools / dcpomatic_player.cc
index 5ce02b1ea1d8e2e2f0b538dac0c20beb417b1c4e..c4f0e886c3ff43f15a4d43aea7159bd24039e229 100644 (file)
@@ -254,6 +254,7 @@ public:
                } else {
                        _controls = new StandardControls (_overall_panel, _viewer, false);
                }
+               _controls->set_film(_viewer.film());
                _viewer.set_dcp_decode_reduction(Config::instance()->decode_reduction());
                _viewer.set_optimise_for_j2k(true);
                _viewer.PlaybackPermitted.connect(bind(&DOMFrame::playback_permitted, this));
@@ -453,9 +454,9 @@ public:
                _info->triggered_update ();
        }
 
-       void film_changed (ChangeType type, Film::Property property)
+       void film_changed (ChangeType type, FilmProperty property)
        {
-               if (type != ChangeType::DONE || property != Film::Property::CONTENT) {
+               if (type != ChangeType::DONE || property != FilmProperty::CONTENT) {
                        return;
                }
 
@@ -907,14 +908,14 @@ private:
                DCPOMATIC_ASSERT (dcp);
 
                auto job = make_shared<VerifyDCPJob>(dcp->directories());
-               auto progress = make_wx<VerifyDCPProgressDialog>(this, _("DCP-o-matic Player"));
-               bool const completed = progress->run (job);
-               if (!completed) {
-                       return;
-               }
+               VerifyDCPProgressDialog progress(this, _("DCP-o-matic Player"));
+               bool const completed = progress.run(job);
+               progress.Close();
 
-               auto d = make_wx<VerifyDCPDialog>(this, job);
-               d->ShowModal ();
+               if (completed) {
+                       VerifyDCPDialog dialog(this, job);
+                       dialog.ShowModal();
+               }
        }
 
        void tools_check_for_updates ()
@@ -1171,7 +1172,7 @@ private:
 
        bool OnInit () override
        {
-               wx_ptr<wxSplashScreen> splash;
+               wxSplashScreen* splash;
                try {
                        wxInitAllImageHandlers ();