From be436f229587905e89ac768b3c57b0e983cfe7fa Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 5 Jul 2021 15:21:45 +0200 Subject: [PATCH] C++11 tidying. --- src/lib/player.h | 24 +++++++++++++++--------- src/wx/report_problem_dialog.cc | 28 +++++++++++++++++----------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/lib/player.h b/src/lib/player.h index 8fc02d9c6..daade1d7b 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -18,26 +18,30 @@ */ + #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 #include + 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. */ diff --git a/src/wx/report_problem_dialog.cc b/src/wx/report_problem_dialog.cc index 8ec275b4e..5497908ca 100644 --- a/src/wx/report_problem_dialog.cc +++ b/src/wx/report_problem_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2018 Carl Hetherington + Copyright (C) 2014-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,18 +18,22 @@ */ + +#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 + +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 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 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 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 (new SendProblemReportJob (_film, wx_to_std (_email->GetValue ()), wx_to_std (_summary->GetValue ())))); + JobManager::instance()->add (make_shared(_film, wx_to_std(_email->GetValue()), wx_to_std(_summary->GetValue()))); } + -- 2.30.2