C++11 tidying.
authorCarl Hetherington <cth@carlh.net>
Mon, 5 Jul 2021 13:21:45 +0000 (15:21 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 5 Jul 2021 13:22:56 +0000 (15:22 +0200)
src/lib/player.h
src/wx/report_problem_dialog.cc

index 8fc02d9c676312829ce8fb2ee497bf9c0ebeefd2..daade1d7bf6452c98838304a4772cae5cdabc678 100644 (file)
 
 */
 
+
 #ifndef DCPOMATIC_PLAYER_H
 #define DCPOMATIC_PLAYER_H
 
-#include "atmos_metadata.h"
-#include "player_text.h"
+
 #include "active_text.h"
-#include "content_text.h"
-#include "film.h"
+#include "atmos_metadata.h"
+#include "audio_merger.h"
+#include "audio_stream.h"
 #include "content.h"
 #include "content_atmos.h"
-#include "position_image.h"
-#include "piece.h"
-#include "content_video.h"
 #include "content_audio.h"
-#include "audio_stream.h"
-#include "audio_merger.h"
+#include "content_text.h"
+#include "content_video.h"
 #include "empty.h"
+#include "film.h"
+#include "piece.h"
+#include "player_text.h"
+#include "position_image.h"
+#include "shuffler.h"
 #include <boost/atomic.hpp>
 #include <list>
 
+
 namespace dcp {
        class ReelAsset;
 }
@@ -53,6 +57,7 @@ class AudioBuffers;
 class ReferencedReelAsset;
 class Shuffler;
 
+
 class PlayerProperty
 {
 public:
@@ -64,6 +69,7 @@ public:
        static int const PLAYBACK_LENGTH;
 };
 
+
 /** @class Player
  *  @brief A class which can play a Playlist.
  */
index 8ec275b4e3b0de9254179c3e95cb61d9f4159eff..5497908ca69b413336412bb52530ad9fe2be7a4b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
+#include "check_box.h"
 #include "report_problem_dialog.h"
-#include "wx_util.h"
 #include "static_text.h"
-#include "check_box.h"
+#include "wx_util.h"
 #include "lib/config.h"
 #include "lib/job_manager.h"
 #include "lib/send_problem_report_job.h"
 #include <wx/sizer.h>
 
+
+using std::make_shared;
 using std::string;
 using std::shared_ptr;
 
+
 /** @param parent Parent window.
  *  @param film Film that we are working on, or 0.
  */
@@ -45,21 +49,21 @@ ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr<Film> fil
 
        _overall_sizer->Add (_table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
 
-       wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
+       auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
        if (buttons) {
                _overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
        }
 
-       wxString t = _("My problem is");
+       auto t = _("My problem is");
        int flags = wxALIGN_TOP | wxLEFT | wxRIGHT;
 #ifdef __WXOSX__
        flags |= wxALIGN_RIGHT;
        t += wxT (":");
 #endif
-       wxStaticText* m = new StaticText (this, t);
+       auto m = new StaticText (this, t);
        _table->Add (m, 1, flags, 6);
 
-       _summary = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxSize (320, 240), wxTE_MULTILINE);
+       _summary = new wxTextCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(320, 240), wxTE_MULTILINE);
        _table->Add (_summary, 1, wxEXPAND | wxALIGN_TOP);
 
        _send_logs = new CheckBox (this, _("Send logs"));
@@ -90,7 +94,7 @@ ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr<Film> fil
                }
        }
 
-       wxStaticText* n = new StaticText (this, wxT (""));
+       auto n = new StaticText (this, wxT(""));
        n->SetLabelMarkup (out);
        _table->AddSpacer (0);
        _table->Add (n, 1, wxEXPAND);
@@ -101,18 +105,20 @@ ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr<Film> fil
        _summary->SetFocus ();
 }
 
+
 void
 ReportProblemDialog::report ()
 {
-       if (_email->GetValue().IsEmpty ()) {
+       if (_email->GetValue().IsEmpty()) {
                error_dialog (this, _("Please enter an email address so that we can contact you with any queries about the problem."));
                return;
        }
 
        if (_email->GetValue() == "carl@dcpomatic.com" || _email->GetValue() == "cth@carlh.net") {
-               error_dialog (this, wxString::Format (_("Enter your email address for the contact, not %s"), _email->GetValue().data()));
+               error_dialog (this, wxString::Format(_("Enter your email address for the contact, not %s"), _email->GetValue().data()));
                return;
        }
 
-       JobManager::instance()->add (shared_ptr<Job> (new SendProblemReportJob (_film, wx_to_std (_email->GetValue ()), wx_to_std (_summary->GetValue ()))));
+       JobManager::instance()->add (make_shared<SendProblemReportJob>(_film, wx_to_std(_email->GetValue()), wx_to_std(_summary->GetValue())));
 }
+