Assorted tidying up.
authorCarl Hetherington <cth@carlh.net>
Wed, 20 Oct 2021 21:12:41 +0000 (22:12 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 2 Dec 2021 23:21:28 +0000 (00:21 +0100)
src/tools/dcpomatic_cli.cc
src/wx/audio_gain_dialog.cc
src/wx/audio_gain_dialog.h
src/wx/download_certificate_dialog.cc
src/wx/download_certificate_dialog.h
src/wx/job_view.cc
src/wx/job_view.h
src/wx/password_entry.cc
src/wx/password_entry.h

index 95f2f40397ecf95c0d763948b784123f68d18a9b..a06040ef9e35e506c8aafc0a94c82e967e783a55 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
+#include "lib/audio_content.h"
+#include "lib/config.h"
+#include "lib/cross.h"
+#include "lib/dcpomatic_log.h"
+#include "lib/encode_server_finder.h"
 #include "lib/film.h"
 #include "lib/filter.h"
-#include "lib/transcode_job.h"
 #include "lib/job_manager.h"
-#include "lib/util.h"
-#include "lib/version.h"
-#include "lib/cross.h"
-#include "lib/config.h"
-#include "lib/log.h"
-#include "lib/signal_manager.h"
-#include "lib/encode_server_finder.h"
 #include "lib/json_server.h"
+#include "lib/log.h"
 #include "lib/ratio.h"
+#include "lib/signal_manager.h"
+#include "lib/transcode_job.h"
+#include "lib/util.h"
+#include "lib/version.h"
 #include "lib/video_content.h"
-#include "lib/audio_content.h"
-#include "lib/dcpomatic_log.h"
 #include <dcp/version.h>
 #include <getopt.h>
 #include <iostream>
 #include <iomanip>
 
-using std::string;
+
 using std::cerr;
 using std::cout;
-using std::vector;
+using std::dynamic_pointer_cast;
+using std::list;
+using std::make_shared;
 using std::pair;
 using std::setw;
-using std::list;
 using std::shared_ptr;
+using std::string;
+using std::vector;
 using boost::optional;
-using std::dynamic_pointer_cast;
+
 
 static void
 help (string n)
@@ -72,6 +76,7 @@ help (string n)
             << "<FILM> is the film directory.\n";
 }
 
+
 static void
 print_dump (shared_ptr<Film> film)
 {
@@ -120,6 +125,7 @@ print_dump (shared_ptr<Film> film)
        }
 }
 
+
 static void
 list_servers ()
 {
@@ -327,7 +333,7 @@ main (int argc, char* argv[])
 
        shared_ptr<Film> film;
        try {
-               film.reset (new Film (film_dir));
+               film = make_shared<Film>(film_dir);
                film->read_metadata ();
        } catch (std::exception& e) {
                cerr << argv[0] << ": error reading film `" << film_dir.string() << "' (" << e.what() << ")\n";
index fb9bd25447b4aba3ad9b01255ae5423d7e7389fb..a53d7e4d9719e5168ed5107ad13ec0e7ddb12961 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "audio_gain_dialog.h"
 #include "wx_util.h"
 #include "lib/util.h"
-#include <cmath>
 #include <wx/spinctrl.h>
+#include <cmath>
+
 
 AudioGainDialog::AudioGainDialog (wxWindow* parent, int c, int d, float v)
        : TableDialog (parent, _("Channel gain"), 3, 1, true)
@@ -42,6 +44,7 @@ AudioGainDialog::AudioGainDialog (wxWindow* parent, int c, int d, float v)
        _gain->SetFocus ();
 }
 
+
 float
 AudioGainDialog::value () const
 {
index 9f9c973cf6691e4a4a0b53a89cb135da8e710a9f..2fd0d5cba1628b3d3fd230a312f112dbb20949c2 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "table_dialog.h"
 
+
 class wxSpinCtrlDouble;
 
+
 class AudioGainDialog : public TableDialog
 {
 public:
index 627223c460d77d10c8b5d086645119db47efd343..89102c0849f1cb8a49270056344231bc35b1009b 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 "dolby_doremi_certificate_panel.h"
+
 #include "barco_alchemy_certificate_panel.h"
 #include "christie_certificate_panel.h"
+#include "dcpomatic_button.h"
+#include "dolby_doremi_certificate_panel.h"
+#include "download_certificate_dialog.h"
 #include "gdc_certificate_panel.h"
 #include "qube_certificate_panel.h"
-#include "download_certificate_dialog.h"
 #include "static_text.h"
 #include "wx_util.h"
-#include "dcpomatic_button.h"
+
 
 using boost::optional;
 
+
 DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
        : wxDialog (parent, wxID_ANY, _("Download certificate"))
 {
-       wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
+       auto sizer = new wxBoxSizer (wxVERTICAL);
 
        _notebook = new wxNotebook (this, wxID_ANY);
        sizer->Add (_notebook, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
@@ -59,7 +62,7 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
                _notebook->AddPage (i, i->name(), true);
        }
 
-       wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
+       auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
        if (buttons) {
                sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
        }
@@ -77,36 +80,41 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
        setup_sensitivity ();
 }
 
+
 DownloadCertificateDialog::~DownloadCertificateDialog ()
 {
        _notebook->Unbind (wxEVT_NOTEBOOK_PAGE_CHANGED, &DownloadCertificateDialog::page_changed, this);
 }
 
+
 void
 DownloadCertificateDialog::download ()
 {
        _pages[_notebook->GetSelection()]->download ();
 }
 
+
 dcp::Certificate
 DownloadCertificateDialog::certificate () const
 {
-       optional<dcp::Certificate> c = _pages[_notebook->GetSelection()]->certificate ();
+       auto c = _pages[_notebook->GetSelection()]->certificate();
        DCPOMATIC_ASSERT (c);
        return c.get ();
 }
 
+
 void
 DownloadCertificateDialog::setup_sensitivity ()
 {
-       DownloadCertificatePanel* p = _pages[_notebook->GetSelection()];
+       auto p = _pages[_notebook->GetSelection()];
        _download->Enable (p->ready_to_download ());
-       wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
+       auto ok = dynamic_cast<wxButton *>(FindWindowById(wxID_OK, this));
        if (ok) {
-               ok->Enable (static_cast<bool>(p->certificate ()));
+               ok->Enable (static_cast<bool>(p->certificate()));
        }
 }
 
+
 void
 DownloadCertificateDialog::page_changed (wxNotebookEvent& ev)
 {
index ef241a0cab5d046ba9b2edcfed25af74a6f34627..e74968b694559709d30f3f0527829af8908136bb 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.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "lib/warnings.h"
 #include <dcp/certificate.h>
 DCPOMATIC_DISABLE_WARNINGS
@@ -25,8 +26,10 @@ DCPOMATIC_DISABLE_WARNINGS
 #include <wx/notebook.h>
 DCPOMATIC_ENABLE_WARNINGS
 
+
 class DownloadCertificatePanel;
 
+
 class DownloadCertificateDialog : public wxDialog
 {
 public:
index 77620142473af4a6d0823da4c283d2ffefbad0d9..7f170c321c142350d7d612511fb0d4814f27e624 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 */
 
 
+#include "check_box.h"
+#include "dcpomatic_button.h"
 #include "job_view.h"
-#include "wx_util.h"
 #include "message_dialog.h"
 #include "static_text.h"
-#include "check_box.h"
-#include "dcpomatic_button.h"
-#include "lib/job.h"
-#include "lib/job_manager.h"
+#include "wx_util.h"
+#include "lib/analyse_audio_job.h"
 #include "lib/compose.hpp"
 #include "lib/config.h"
+#include "lib/job.h"
+#include "lib/job_manager.h"
 #include "lib/send_notification_email_job.h"
 #include "lib/transcode_job.h"
-#include "lib/analyse_audio_job.h"
 #include <wx/wx.h>
 #include <boost/algorithm/string.hpp>
 
 
-using std::string;
+using std::dynamic_pointer_cast;
 using std::min;
 using std::shared_ptr;
+using std::string;
 using boost::bind;
-using std::dynamic_pointer_cast;
 
 
 JobView::JobView (shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table)
index 4a602fc6229b0b82542e065c8a584ed0816c10dd..fdc96d139d5adc9761d93c2fec31ac31880faf5e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_JOB_VIEW_H
 #define DCPOMATIC_JOB_VIEW_H
 
+
 #include <boost/signals2.hpp>
 
+
 class Job;
-class wxScrolledWindow;
-class wxWindow;
-class wxFlexGridSizer;
-class wxCommandEvent;
 class wxBoxSizer;
-class wxGauge;
-class wxStaticText;
 class wxButton;
-class wxSizer;
 class wxCheckBox;
+class wxCommandEvent;
+class wxFlexGridSizer;
+class wxGauge;
+class wxScrolledWindow;
+class wxSizer;
+class wxStaticText;
+class wxWindow;
+
 
 class JobView
 {
@@ -67,7 +71,6 @@ protected:
        wxBoxSizer* _gauge_message;
 
 private:
-
        virtual void finish_setup (wxWindow *, wxSizer *) {}
 
        void progress ();
@@ -90,4 +93,5 @@ private:
        boost::signals2::scoped_connection _finished_connection;
 };
 
+
 #endif
index f44ed9cb07c5f5d631efbf1abe16b9af9fa41c10..4dd8947182a029ac5d793a3219b6854cde73e1ae 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2019-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
-#include "password_entry.h"
+
 #include "check_box.h"
+#include "password_entry.h"
 #include "wx_util.h"
 
+
 using std::string;
 using boost::bind;
 
+
 PasswordEntry::PasswordEntry (wxWindow* parent)
 {
        _panel = new wxPanel (parent, wxID_ANY);
-       wxBoxSizer* sizer = new wxBoxSizer (wxHORIZONTAL);
+       auto sizer = new wxBoxSizer (wxHORIZONTAL);
        _text = new wxTextCtrl (_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
        sizer->Add (_text, 1, wxRIGHT, DCPOMATIC_SIZER_GAP);
        _show = new CheckBox (_panel, _("Show"));
@@ -39,18 +42,20 @@ PasswordEntry::PasswordEntry (wxWindow* parent)
        _text->Bind (wxEVT_TEXT, bind(boost::ref(Changed)));
 }
 
+
 wxPanel *
 PasswordEntry::get_panel () const
 {
        return _panel;
 }
 
+
 void
 PasswordEntry::show_clicked ()
 {
        _panel->Freeze ();
-       wxString const pass = _text->GetValue ();
-       wxSizer* sizer = _text->GetContainingSizer ();
+       auto const pass = _text->GetValue ();
+       auto sizer = _text->GetContainingSizer ();
        long from, to;
        _text->GetSelection (&from, &to);
        sizer->Detach (_text);
@@ -63,12 +68,14 @@ PasswordEntry::show_clicked ()
        _panel->Thaw ();
 }
 
+
 string
 PasswordEntry::get () const
 {
        return wx_to_std (_text->GetValue());
 }
 
+
 void
 PasswordEntry::set (string s)
 {
index 5939e5264ec31b3dab288c21acb4bcb889907b56..d8cbfffedb43962ad055746e6a5d984f3d084aa4 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2019-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "lib/warnings.h"
 DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
+
 class CheckBox;
 
+
 class PasswordEntry
 {
 public: