/*
- 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)
<< "<FILM> is the film directory.\n";
}
+
static void
print_dump (shared_ptr<Film> film)
{
}
}
+
static void
list_servers ()
{
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";
/*
- 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)
_gain->SetFocus ();
}
+
float
AudioGainDialog::value () const
{
/*
- 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:
/*
- 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);
_notebook->AddPage (i, i->name(), true);
}
- wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
+ auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
if (buttons) {
sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
}
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)
{
/*
- 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 "lib/warnings.h"
#include <dcp/certificate.h>
DCPOMATIC_DISABLE_WARNINGS
#include <wx/notebook.h>
DCPOMATIC_ENABLE_WARNINGS
+
class DownloadCertificatePanel;
+
class DownloadCertificateDialog : public wxDialog
{
public:
/*
- 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)
/*
- 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
{
wxBoxSizer* _gauge_message;
private:
-
virtual void finish_setup (wxWindow *, wxSizer *) {}
void progress ();
boost::signals2::scoped_connection _finished_connection;
};
+
#endif
/*
- 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"));
_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);
_panel->Thaw ();
}
+
string
PasswordEntry::get () const
{
return wx_to_std (_text->GetValue());
}
+
void
PasswordEntry::set (string s)
{
/*
- 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: