summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-01-31 03:14:24 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-31 03:14:24 +0100
commit8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8 (patch)
treef8b25b13ac3732838be259e469d045438d999e7b /src/wx
parent4985d87750c87019dfe5dc7ef44e12c45326dd0e (diff)
More enum class additions.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/audio_dialog.cc16
-rw-r--r--src/wx/closed_captions_dialog.cc2
-rw-r--r--src/wx/content_panel.cc12
-rw-r--r--src/wx/content_panel.h2
-rw-r--r--src/wx/content_widget.h6
-rw-r--r--src/wx/controls.cc4
-rw-r--r--src/wx/dcp_panel.cc10
-rw-r--r--src/wx/export_video_file_dialog.cc4
-rw-r--r--src/wx/film_editor.cc4
-rw-r--r--src/wx/film_viewer.cc12
-rw-r--r--src/wx/full_config_dialog.cc20
-rw-r--r--src/wx/hints_dialog.cc6
-rw-r--r--src/wx/smpte_metadata_dialog.cc22
-rw-r--r--src/wx/subtitle_appearance_dialog.cc44
-rw-r--r--src/wx/text_panel.cc76
-rw-r--r--src/wx/timeline.cc8
-rw-r--r--src/wx/timeline_content_view.cc22
-rw-r--r--src/wx/timeline_dialog.cc10
-rw-r--r--src/wx/video_view.cc10
19 files changed, 145 insertions, 145 deletions
diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc
index 41b2a9d39..b8c7f7b73 100644
--- a/src/wx/audio_dialog.cc
+++ b/src/wx/audio_dialog.cc
@@ -314,12 +314,12 @@ AudioDialog::channel_clicked (wxCommandEvent& ev)
void
AudioDialog::film_change (ChangeType type, int p)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
if (p == Film::AUDIO_CHANNELS) {
- shared_ptr<Film> film = _film.lock ();
+ auto film = _film.lock ();
if (film) {
_channels = film->audio_channels ();
try_to_load_analysis ();
@@ -330,7 +330,7 @@ AudioDialog::film_change (ChangeType type, int p)
void
AudioDialog::content_change (ChangeType type, int p)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
@@ -375,12 +375,12 @@ AudioDialog::setup_statistics ()
return;
}
- shared_ptr<Film> film = _film.lock ();
+ auto film = _film.lock ();
if (!film) {
return;
}
- pair<AudioAnalysis::PeakTime, int> const peak = _analysis->overall_sample_peak ();
+ auto const peak = _analysis->overall_sample_peak ();
float const peak_dB = linear_to_db(peak.first.peak) + _analysis->gain_correction(_playlist);
_sample_peak->SetLabel (
wxString::Format (
@@ -412,7 +412,7 @@ AudioDialog::setup_statistics ()
/* XXX: check whether it's ok to add dB gain to these quantities */
- if (static_cast<bool>(_analysis->integrated_loudness ())) {
+ if (static_cast<bool>(_analysis->integrated_loudness())) {
_integrated_loudness->SetLabel (
wxString::Format (
_("Integrated loudness %.2f LUFS"),
@@ -421,7 +421,7 @@ AudioDialog::setup_statistics ()
);
}
- if (static_cast<bool>(_analysis->loudness_range ())) {
+ if (static_cast<bool>(_analysis->loudness_range())) {
_loudness_range->SetLabel (
wxString::Format (
_("Loudness range %.2f LU"),
@@ -455,7 +455,7 @@ AudioDialog::set_cursor (optional<DCPTime> time, optional<float> db)
return;
}
- shared_ptr<Film> film = _film.lock();
+ auto film = _film.lock();
DCPOMATIC_ASSERT (film);
_cursor->SetLabel (wxString::Format (_("Cursor: %.1fdB at %s"), *db, time->timecode(film->video_frame_rate())));
}
diff --git a/src/wx/closed_captions_dialog.cc b/src/wx/closed_captions_dialog.cc
index c23c2902b..f2528a00f 100644
--- a/src/wx/closed_captions_dialog.cc
+++ b/src/wx/closed_captions_dialog.cc
@@ -239,7 +239,7 @@ ClosedCaptionsDialog::update_tracks (shared_ptr<const Film> film)
for (auto i: film->content()) {
for (auto j: i->text) {
- if (j->use() && j->type() == TEXT_CLOSED_CAPTION && j->dcp_track()) {
+ if (j->use() && j->type() == TextType::CLOSED_CAPTION && j->dcp_track()) {
if (find(_tracks.begin(), _tracks.end(), j->dcp_track()) == _tracks.end()) {
_tracks.push_back (*j->dcp_track());
}
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 0530c9128..a06791d4d 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -78,7 +78,7 @@ ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmV
, _ignore_deselect (false)
, _no_check_selection (false)
{
- for (int i = 0; i < TEXT_COUNT; ++i) {
+ for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
_text_panel[i] = 0;
}
@@ -331,7 +331,7 @@ ContentPanel::check_selection ()
bool have_video = false;
bool have_audio = false;
- bool have_text[TEXT_COUNT] = { false, false };
+ bool have_text[static_cast<int>(TextType::COUNT)] = { false, false };
for (auto i: selected()) {
if (i->video) {
have_video = true;
@@ -340,7 +340,7 @@ ContentPanel::check_selection ()
have_audio = true;
}
for (auto j: i->text) {
- have_text[j->original_type()] = true;
+ have_text[static_cast<int>(j->original_type())] = true;
}
}
@@ -370,7 +370,7 @@ ContentPanel::check_selection ()
++off;
}
- for (int i = 0; i < TEXT_COUNT; ++i) {
+ for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
if (have_text[i] && !_text_panel[i]) {
_text_panel[i] = new TextPanel (this, static_cast<TextType>(i));
_notebook->InsertPage (off, _text_panel[i], _text_panel[i]->name());
@@ -570,7 +570,7 @@ ContentPanel::setup_sensitivity ()
if (_audio_panel) {
_audio_panel->Enable (_generally_sensitive && audio_selection.size() > 0);
}
- for (int i = 0; i < TEXT_COUNT; ++i) {
+ for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
if (_text_panel[i]) {
_text_panel[i]->Enable (_generally_sensitive && selection.size() == 1 && !selection.front()->text.empty());
}
@@ -790,7 +790,7 @@ ContentPanel::panels () const
if (_audio_panel) {
p.push_back (_audio_panel);
}
- for (int i = 0; i < TEXT_COUNT; ++i) {
+ for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
if (_text_panel[i]) {
p.push_back (_text_panel[i]);
}
diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h
index 6a9ef3f4a..124fd6b94 100644
--- a/src/wx/content_panel.h
+++ b/src/wx/content_panel.h
@@ -136,7 +136,7 @@ private:
wxButton* _timeline;
VideoPanel* _video_panel;
AudioPanel* _audio_panel;
- TextPanel* _text_panel[TEXT_COUNT];
+ TextPanel* _text_panel[static_cast<int>(TextType::COUNT)];
TimingPanel* _timing_panel;
ContentMenu* _menu;
TimelineDialog* _timeline_dialog;
diff --git a/src/wx/content_widget.h b/src/wx/content_widget.h
index d38609cb4..1a9c85dde 100644
--- a/src/wx/content_widget.h
+++ b/src/wx/content_widget.h
@@ -195,14 +195,14 @@ private:
void button_clicked ()
{
U const v = boost::bind (_model_getter, _part(_content.front().get()).get())();
- for (typename List::iterator i = _content.begin (); i != _content.end(); ++i) {
- boost::bind (_model_setter, _part(i->get()).get(), v) ();
+ for (auto const& i: _content) {
+ boost::bind (_model_setter, _part(i.get()).get(), v)();
}
}
void model_changed (ChangeType type, int property)
{
- if (type == CHANGE_TYPE_DONE && property == _property && !_ignore_model_changes) {
+ if (type == ChangeType::DONE && property == _property && !_ignore_model_changes) {
update_from_model ();
}
}
diff --git a/src/wx/controls.cc b/src/wx/controls.cc
index 5364e1614..311343400 100644
--- a/src/wx/controls.cc
+++ b/src/wx/controls.cc
@@ -190,7 +190,7 @@ Controls::update_position ()
void
Controls::eye_changed ()
{
- _viewer->set_eyes (_eye->GetSelection() == 0 ? EYES_LEFT : EYES_RIGHT);
+ _viewer->set_eyes (_eye->GetSelection() == 0 ? Eyes::LEFT : Eyes::RIGHT);
}
void
@@ -407,7 +407,7 @@ Controls::film () const
void
Controls::film_change (ChangeType type, Film::Property p)
{
- if (type == CHANGE_TYPE_DONE) {
+ if (type == ChangeType::DONE) {
if (p == Film::CONTENT) {
setup_sensitivity ();
update_position_label ();
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index 047768f56..cf4d5d3fe 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -286,7 +286,7 @@ DCPPanel::resolution_changed ()
return;
}
- _film->set_resolution (_resolution->GetSelection() == 0 ? RESOLUTION_2K : RESOLUTION_4K);
+ _film->set_resolution (_resolution->GetSelection() == 0 ? Resolution::TWO_K : Resolution::FOUR_K);
}
void
@@ -354,7 +354,7 @@ DCPPanel::film_changed (int p)
checked_set (_encrypted, _film->encrypted ());
break;
case Film::RESOLUTION:
- checked_set (_resolution, _film->resolution() == RESOLUTION_2K ? 0 : 1);
+ checked_set (_resolution, _film->resolution() == Resolution::TWO_K ? 0 : 1);
setup_container ();
setup_dcp_name ();
break;
@@ -433,8 +433,8 @@ DCPPanel::film_changed (int p)
film_changed (Film::AUDIO_CHANNELS);
break;
case Film::REEL_TYPE:
- checked_set (_reel_type, _film->reel_type ());
- _reel_length->Enable (_film->reel_type() == REELTYPE_BY_LENGTH);
+ checked_set (_reel_type, static_cast<int>(_film->reel_type()));
+ _reel_length->Enable (_film->reel_type() == ReelType::BY_LENGTH);
break;
case Film::REEL_LENGTH:
checked_set (_reel_length, _film->reel_length() / 1000000000LL);
@@ -586,7 +586,7 @@ DCPPanel::setup_sensitivity ()
_copy_isdcf_name_button->Enable (_generally_sensitive);
_encrypted->Enable (_generally_sensitive);
_reel_type->Enable (_generally_sensitive && _film && !_film->references_dcp_video() && !_film->references_dcp_audio());
- _reel_length->Enable (_generally_sensitive && _film && _film->reel_type() == REELTYPE_BY_LENGTH);
+ _reel_length->Enable (_generally_sensitive && _film && _film->reel_type() == ReelType::BY_LENGTH);
_markers->Enable (_generally_sensitive && _film && !_film->interop());
_metadata->Enable (_generally_sensitive);
_frame_rate_choice->Enable (_generally_sensitive && _film && !_film->references_dcp_video() && !_film->contains_atmos_content());
diff --git a/src/wx/export_video_file_dialog.cc b/src/wx/export_video_file_dialog.cc
index f1b2d2622..30ea6ef47 100644
--- a/src/wx/export_video_file_dialog.cc
+++ b/src/wx/export_video_file_dialog.cc
@@ -49,8 +49,8 @@ wxString format_extensions[] = {
};
ExportFormat formats[] = {
- EXPORT_FORMAT_PRORES,
- EXPORT_FORMAT_H264_AAC,
+ ExportFormat::PRORES,
+ ExportFormat::H264_AAC,
};
ExportVideoFileDialog::ExportVideoFileDialog (wxWindow* parent, string name)
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index bb40dad9f..47a6358cc 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -73,7 +73,7 @@ FilmEditor::FilmEditor (wxWindow* parent, weak_ptr<FilmViewer> viewer)
void
FilmEditor::film_change (ChangeType type, Film::Property p)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
@@ -95,7 +95,7 @@ FilmEditor::film_change (ChangeType type, Film::Property p)
void
FilmEditor::film_content_change (ChangeType type, int property)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index e8c3b8c71..f31553239 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -184,8 +184,8 @@ FilmViewer::set_film (shared_ptr<Film> film)
_film->LengthChange.connect (boost::bind(&FilmViewer::film_length_change, this));
_player->Change.connect (boost::bind (&FilmViewer::player_change, this, _1, _2, _3));
- film_change (CHANGE_TYPE_DONE, Film::VIDEO_FRAME_RATE);
- film_change (CHANGE_TYPE_DONE, Film::THREE_D);
+ film_change (ChangeType::DONE, Film::VIDEO_FRAME_RATE);
+ film_change (ChangeType::DONE, Film::THREE_D);
film_length_change ();
/* Keep about 1 second's worth of history samples */
@@ -376,7 +376,7 @@ FilmViewer::stop ()
void
FilmViewer::player_change (ChangeType type, int property, bool frequent)
{
- if (type != CHANGE_TYPE_DONE || frequent) {
+ if (type != ChangeType::DONE || frequent) {
return;
}
@@ -407,7 +407,7 @@ FilmViewer::player_change (ChangeType type, int property, bool frequent)
void
FilmViewer::film_change (ChangeType type, Film::Property p)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
@@ -464,7 +464,7 @@ FilmViewer::set_coalesce_player_changes (bool c)
if (!c) {
for (auto i: _pending_player_changes) {
- player_change (CHANGE_TYPE_DONE, i, false);
+ player_change (ChangeType::DONE, i, false);
}
_pending_player_changes.clear ();
}
@@ -710,7 +710,7 @@ FilmViewer::gets () const
void
FilmViewer::content_change (ChangeType type, int property)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc
index e17e0a57b..43c76fddb 100644
--- a/src/wx/full_config_dialog.cc
+++ b/src/wx/full_config_dialog.cc
@@ -586,7 +586,7 @@ private:
Config* config = Config::instance ();
checked_set (_upload, config->upload_after_make_dcp());
- checked_set (_tms_protocol, config->tms_protocol ());
+ checked_set (_tms_protocol, static_cast<int>(config->tms_protocol()));
checked_set (_tms_ip, config->tms_ip ());
checked_set (_tms_path, config->tms_path ());
checked_set (_tms_user, config->tms_user ());
@@ -700,21 +700,21 @@ private:
void config_changed ()
{
- Config* config = Config::instance ();
+ auto config = Config::instance ();
checked_set (_server, config->mail_server ());
checked_set (_port, config->mail_port ());
switch (config->mail_protocol()) {
- case EMAIL_PROTOCOL_AUTO:
+ case EmailProtocol::AUTO:
checked_set (_protocol, 0);
break;
- case EMAIL_PROTOCOL_PLAIN:
+ case EmailProtocol::PLAIN:
checked_set (_protocol, 1);
break;
- case EMAIL_PROTOCOL_STARTTLS:
+ case EmailProtocol::STARTTLS:
checked_set (_protocol, 2);
break;
- case EMAIL_PROTOCOL_SSL:
+ case EmailProtocol::SSL:
checked_set (_protocol, 3);
break;
}
@@ -736,16 +736,16 @@ private:
{
switch (_protocol->GetSelection()) {
case 0:
- Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_AUTO);
+ Config::instance()->set_mail_protocol(EmailProtocol::AUTO);
break;
case 1:
- Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_PLAIN);
+ Config::instance()->set_mail_protocol(EmailProtocol::PLAIN);
break;
case 2:
- Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_STARTTLS);
+ Config::instance()->set_mail_protocol(EmailProtocol::STARTTLS);
break;
case 3:
- Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_SSL);
+ Config::instance()->set_mail_protocol(EmailProtocol::SSL);
break;
}
}
diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc
index 2c6bac14a..2e53d8104 100644
--- a/src/wx/hints_dialog.cc
+++ b/src/wx/hints_dialog.cc
@@ -87,20 +87,20 @@ HintsDialog::HintsDialog (wxWindow* parent, std::weak_ptr<Film> film, bool ok)
_film_content_change_connection = locked_film->ContentChange.connect (boost::bind (&HintsDialog::film_content_change, this, _1));
}
- film_change (CHANGE_TYPE_DONE);
+ film_change (ChangeType::DONE);
}
void
HintsDialog::film_change (ChangeType type)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
_text->Clear ();
_current.clear ();
- std::shared_ptr<Film> film = _film.lock ();
+ auto film = _film.lock ();
if (!film) {
return;
}
diff --git a/src/wx/smpte_metadata_dialog.cc b/src/wx/smpte_metadata_dialog.cc
index 772250701..b8a1184e0 100644
--- a/src/wx/smpte_metadata_dialog.cc
+++ b/src/wx/smpte_metadata_dialog.cc
@@ -244,16 +244,16 @@ SMPTEMetadataDialog::SMPTEMetadataDialog (wxWindow* parent, weak_ptr<Film> weak_
_film_changed_connection = film()->Change.connect(boost::bind(&SMPTEMetadataDialog::film_changed, this, _1, _2));
- film_changed (CHANGE_TYPE_DONE, Film::NAME_LANGUAGE);
- film_changed (CHANGE_TYPE_DONE, Film::RELEASE_TERRITORY);
- film_changed (CHANGE_TYPE_DONE, Film::VERSION_NUMBER);
- film_changed (CHANGE_TYPE_DONE, Film::STATUS);
- film_changed (CHANGE_TYPE_DONE, Film::CHAIN);
- film_changed (CHANGE_TYPE_DONE, Film::DISTRIBUTOR);
- film_changed (CHANGE_TYPE_DONE, Film::FACILITY);
- film_changed (CHANGE_TYPE_DONE, Film::CONTENT_VERSIONS);
- film_changed (CHANGE_TYPE_DONE, Film::LUMINANCE);
- film_changed (CHANGE_TYPE_DONE, Film::SUBTITLE_LANGUAGES);
+ film_changed (ChangeType::DONE, Film::NAME_LANGUAGE);
+ film_changed (ChangeType::DONE, Film::RELEASE_TERRITORY);
+ film_changed (ChangeType::DONE, Film::VERSION_NUMBER);
+ film_changed (ChangeType::DONE, Film::STATUS);
+ film_changed (ChangeType::DONE, Film::CHAIN);
+ film_changed (ChangeType::DONE, Film::DISTRIBUTOR);
+ film_changed (ChangeType::DONE, Film::FACILITY);
+ film_changed (ChangeType::DONE, Film::CONTENT_VERSIONS);
+ film_changed (ChangeType::DONE, Film::LUMINANCE);
+ film_changed (ChangeType::DONE, Film::SUBTITLE_LANGUAGES);
setup_sensitivity ();
}
@@ -262,7 +262,7 @@ SMPTEMetadataDialog::SMPTEMetadataDialog (wxWindow* parent, weak_ptr<Film> weak_
void
SMPTEMetadataDialog::film_changed (ChangeType type, Film::Property property)
{
- if (type != CHANGE_TYPE_DONE || film()->interop()) {
+ if (type != ChangeType::DONE || film()->interop()) {
return;
}
diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc
index e21093798..ef3f20e7a 100644
--- a/src/wx/subtitle_appearance_dialog.cc
+++ b/src/wx/subtitle_appearance_dialog.cc
@@ -59,7 +59,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
, _content (content)
, _caption (caption)
{
- shared_ptr<FFmpegContent> ff = dynamic_pointer_cast<FFmpegContent> (content);
+ auto ff = dynamic_pointer_cast<FFmpegContent> (content);
if (ff) {
_stream = ff->subtitle_stream ();
/* XXX: assuming that all FFmpeg streams have bitmap subs */
@@ -135,7 +135,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
_overall_sizer->Add (restore, 0, wxALL, DCPOMATIC_SIZER_X_GAP);
}
- wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
+ auto buttons = CreateSeparatedButtonSizer (wxOK);
if (buttons) {
_overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
}
@@ -174,7 +174,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
_effect->SetSelection (NONE);
}
- optional<dcp::Colour> effect_colour = _caption->effect_colour();
+ auto effect_colour = _caption->effect_colour();
_force_effect_colour->SetValue (static_cast<bool>(effect_colour));
if (effect_colour) {
_effect_colour->SetColour (wxColour (effect_colour->r, effect_colour->g, effect_colour->b));
@@ -182,7 +182,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
_effect_colour->SetColour (wxColour (0, 0, 0));
}
- optional<ContentTime> fade_in = _caption->fade_in();
+ auto fade_in = _caption->fade_in();
_force_fade_in->SetValue (static_cast<bool>(fade_in));
if (fade_in) {
_fade_in->set (*fade_in, _content->active_video_frame_rate(film));
@@ -190,7 +190,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
_fade_in->set (ContentTime(), _content->active_video_frame_rate(film));
}
- optional<ContentTime> fade_out = _caption->fade_out();
+ auto fade_out = _caption->fade_out();
_force_fade_out->SetValue (static_cast<bool>(fade_out));
if (fade_out) {
_fade_out->set (*fade_out, _content->active_video_frame_rate(film));
@@ -214,7 +214,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
void
SubtitleAppearanceDialog::content_change (ChangeType type)
{
- if (type == CHANGE_TYPE_DONE) {
+ if (type == ChangeType::DONE) {
setup_sensitivity ();
}
}
@@ -222,8 +222,8 @@ SubtitleAppearanceDialog::content_change (ChangeType type)
wxCheckBox*
SubtitleAppearanceDialog::set_to (wxWindow* w, int& r)
{
- wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- wxCheckBox* set_to = new CheckBox (this, _("Set to"));
+ auto s = new wxBoxSizer (wxHORIZONTAL);
+ auto set_to = new CheckBox (this, _("Set to"));
s->Add (set_to, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 8);
s->Add (w, 0, wxALIGN_CENTER_VERTICAL);
_table->Add (s, wxGBPosition (r, 1));
@@ -234,10 +234,10 @@ SubtitleAppearanceDialog::set_to (wxWindow* w, int& r)
void
SubtitleAppearanceDialog::apply ()
{
- shared_ptr<const Film> film = _film.lock ();
+ auto film = _film.lock ();
if (_force_colour->GetValue ()) {
- wxColour const c = _colour->GetColour ();
+ auto const c = _colour->GetColour ();
_caption->set_colour (dcp::Colour (c.Red(), c.Green(), c.Blue()));
} else {
_caption->unset_colour ();
@@ -258,7 +258,7 @@ SubtitleAppearanceDialog::apply ()
_caption->unset_effect ();
}
if (_force_effect_colour->GetValue ()) {
- wxColour const ec = _effect_colour->GetColour ();
+ auto const ec = _effect_colour->GetColour ();
_caption->set_effect_colour (dcp::Colour (ec.Red(), ec.Green(), ec.Blue()));
} else {
_caption->unset_effect_colour ();
@@ -276,12 +276,12 @@ SubtitleAppearanceDialog::apply ()
_caption->set_outline_width (_outline_width->GetValue ());
if (_stream) {
- for (map<RGBA, RGBAColourPicker*>::const_iterator i = _pickers.begin(); i != _pickers.end(); ++i) {
- _stream->set_colour (i->first, i->second->colour ());
+ for (auto const& i: _pickers) {
+ _stream->set_colour (i.first, i.second->colour());
}
}
- shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (_content);
+ auto fc = dynamic_pointer_cast<FFmpegContent> (_content);
if (fc) {
fc->signal_subtitle_stream_changed ();
}
@@ -290,8 +290,8 @@ SubtitleAppearanceDialog::apply ()
void
SubtitleAppearanceDialog::restore ()
{
- for (map<RGBA, RGBAColourPicker*>::const_iterator i = _pickers.begin(); i != _pickers.end(); ++i) {
- i->second->set (i->first);
+ for (auto const& i: _pickers) {
+ i.second->set (i.first);
}
}
@@ -330,13 +330,13 @@ SubtitleAppearanceDialog::active_jobs_changed (optional<string> last)
void
SubtitleAppearanceDialog::add_colours ()
{
- map<RGBA, RGBA> colours = _stream->colours ();
- for (map<RGBA, RGBA>::const_iterator i = colours.begin(); i != colours.end(); ++i) {
- wxPanel* from = new wxPanel (_colours_panel, wxID_ANY);
- from->SetBackgroundColour (wxColour (i->first.r, i->first.g, i->first.b, i->first.a));
+ auto colours = _stream->colours ();
+ for (auto const& i: _stream->colours()) {
+ auto from = new wxPanel(_colours_panel, wxID_ANY);
+ from->SetBackgroundColour(wxColour(i.first.r, i.first.g, i.first.b, i.first.a));
_colour_table->Add (from, 1, wxEXPAND);
- RGBAColourPicker* to = new RGBAColourPicker (_colours_panel, i->second);
+ auto to = new RGBAColourPicker(_colours_panel, i.second);
_colour_table->Add (to, 1, wxEXPAND);
- _pickers[i->first] = to;
+ _pickers[i.first] = to;
}
}
diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc
index 521e55fc5..dec58f0cd 100644
--- a/src/wx/text_panel.cc
+++ b/src/wx/text_panel.cc
@@ -65,7 +65,7 @@ TextPanel::TextPanel (ContentPanel* p, TextType t)
, _loading_analysis (false)
{
wxString refer = _("Use this DCP's subtitle as OV and make VF");
- if (t == TEXT_CLOSED_CAPTION) {
+ if (t == TextType::CLOSED_CAPTION) {
refer = _("Use this DCP's closed caption as OV and make VF");
}
@@ -145,7 +145,7 @@ void
TextPanel::setup_visibility ()
{
switch (current_type()) {
- case TEXT_OPEN_SUBTITLE:
+ case TextType::OPEN_SUBTITLE:
if (_dcp_track_label) {
_dcp_track_label->Destroy ();
_dcp_track_label = 0;
@@ -161,7 +161,7 @@ TextPanel::setup_visibility ()
}
break;
- case TEXT_CLOSED_CAPTION:
+ case TextType::CLOSED_CAPTION:
if (!_dcp_track_label) {
_dcp_track_label = create_label (this, _("CCAP track"), true);
add_label_to_sizer (_grid, _dcp_track_label, true, wxGBPosition(_ccap_track_row, 0));
@@ -348,7 +348,7 @@ TextPanel::dcp_track_changed ()
if (track) {
for (auto i: _parent->selected_text()) {
shared_ptr<TextContent> t = i->text_of_original_type(_original_type);
- if (t && t->type() == TEXT_CLOSED_CAPTION) {
+ if (t && t->type() == TextType::CLOSED_CAPTION) {
t->set_dcp_track(*track);
}
}
@@ -409,10 +409,10 @@ TextPanel::film_content_changed (int property)
} else if (property == TextContentProperty::TYPE) {
if (text) {
switch (text->type()) {
- case TEXT_OPEN_SUBTITLE:
+ case TextType::OPEN_SUBTITLE:
_type->SetSelection (0);
break;
- case TEXT_CLOSED_CAPTION:
+ case TextType::CLOSED_CAPTION:
_type->SetSelection (1);
break;
default:
@@ -474,12 +474,12 @@ TextPanel::current_type () const
{
switch (_type->GetSelection()) {
case 0:
- return TEXT_OPEN_SUBTITLE;
+ return TextType::OPEN_SUBTITLE;
case 1:
- return TEXT_CLOSED_CAPTION;
+ return TextType::CLOSED_CAPTION;
}
- return TEXT_UNKNOWN;
+ return TextType::UNKNOWN;
}
void
@@ -558,10 +558,10 @@ TextPanel::setup_sensitivity ()
}
switch (type) {
- case TEXT_OPEN_SUBTITLE:
+ case TextType::OPEN_SUBTITLE:
_type->SetSelection (0);
break;
- case TEXT_CLOSED_CAPTION:
+ case TextType::CLOSED_CAPTION:
if (_type->GetCount() > 1) {
_type->SetSelection (1);
}
@@ -574,35 +574,35 @@ TextPanel::setup_sensitivity ()
_use->Enable (!reference && any_subs > 0);
bool const use = _use->GetValue ();
if (_outline_subtitles) {
- _outline_subtitles->Enable (!_loading_analysis && any_subs && use && type == TEXT_OPEN_SUBTITLE);
+ _outline_subtitles->Enable (!_loading_analysis && any_subs && use && type == TextType::OPEN_SUBTITLE);
}
_type->Enable (!reference && any_subs > 0 && use);
- _burn->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
- _x_offset->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
- _y_offset->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
- _x_scale->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
- _y_scale->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
- _line_spacing->Enable (!reference && use && type == TEXT_OPEN_SUBTITLE && dcp_subs < any_subs);
+ _burn->Enable (!reference && any_subs > 0 && use && type == TextType::OPEN_SUBTITLE);
+ _x_offset->Enable (!reference && any_subs > 0 && use && type == TextType::OPEN_SUBTITLE);
+ _y_offset->Enable (!reference && any_subs > 0 && use && type == TextType::OPEN_SUBTITLE);
+ _x_scale->Enable (!reference && any_subs > 0 && use && type == TextType::OPEN_SUBTITLE);
+ _y_scale->Enable (!reference && any_subs > 0 && use && type == TextType::OPEN_SUBTITLE);
+ _line_spacing->Enable (!reference && use && type == TextType::OPEN_SUBTITLE && dcp_subs < any_subs);
_stream->Enable (!reference && ffmpeg_subs == 1);
/* Ideally we would check here to see if the FFmpeg content has "string" subs (i.e. not bitmaps) */
_text_view_button->Enable (!reference && any_subs > 0 && ffmpeg_subs == 0);
- _fonts_dialog_button->Enable (!reference && any_subs > 0 && ffmpeg_subs == 0 && type == TEXT_OPEN_SUBTITLE);
- _appearance_dialog_button->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
+ _fonts_dialog_button->Enable (!reference && any_subs > 0 && ffmpeg_subs == 0 && type == TextType::OPEN_SUBTITLE);
+ _appearance_dialog_button->Enable (!reference && any_subs > 0 && use && type == TextType::OPEN_SUBTITLE);
}
void
TextPanel::stream_changed ()
{
- FFmpegContentList fc = _parent->selected_ffmpeg ();
+ auto fc = _parent->selected_ffmpeg ();
if (fc.size() != 1) {
return;
}
- shared_ptr<FFmpegContent> fcs = fc.front ();
+ auto fcs = fc.front ();
- vector<shared_ptr<FFmpegSubtitleStream> > a = fcs->subtitle_streams ();
- vector<shared_ptr<FFmpegSubtitleStream> >::iterator i = a.begin ();
- string const s = string_client_data (_stream->GetClientObject (_stream->GetSelection ()));
+ auto a = fcs->subtitle_streams ();
+ auto i = a.begin ();
+ auto const s = string_client_data (_stream->GetClientObject (_stream->GetSelection ()));
while (i != a.end() && (*i)->identifier () != s) {
++i;
}
@@ -631,7 +631,7 @@ TextPanel::y_offset_changed ()
void
TextPanel::x_scale_changed ()
{
- ContentList c = _parent->selected_text ();
+ auto c = _parent->selected_text ();
if (c.size() == 1) {
c.front()->text_of_original_type(_original_type)->set_x_scale (_x_scale->GetValue() / 100.0);
}
@@ -694,10 +694,10 @@ TextPanel::fonts_dialog_clicked ()
{
if (_fonts_dialog) {
_fonts_dialog->Destroy ();
- _fonts_dialog = 0;
+ _fonts_dialog = nullptr;
}
- ContentList c = _parent->selected_text ();
+ auto c = _parent->selected_text ();
DCPOMATIC_ASSERT (c.size() == 1);
_fonts_dialog = new FontsDialog (this, c.front(), c.front()->text_of_original_type(_original_type));
@@ -707,12 +707,12 @@ TextPanel::fonts_dialog_clicked ()
void
TextPanel::reference_clicked ()
{
- ContentList c = _parent->selected ();
+ auto c = _parent->selected ();
if (c.size() != 1) {
return;
}
- shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (c.front ());
+ auto d = dynamic_pointer_cast<DCPContent> (c.front ());
if (!d) {
return;
}
@@ -723,10 +723,10 @@ TextPanel::reference_clicked ()
void
TextPanel::appearance_dialog_clicked ()
{
- ContentList c = _parent->selected_text ();
+ auto c = _parent->selected_text ();
DCPOMATIC_ASSERT (c.size() == 1);
- SubtitleAppearanceDialog* d = new SubtitleAppearanceDialog (this, _parent->film(), c.front(), c.front()->text_of_original_type(_original_type));
+ auto d = new SubtitleAppearanceDialog (this, _parent->film(), c.front(), c.front()->text_of_original_type(_original_type));
if (d->ShowModal () == wxID_OK) {
d->apply ();
}
@@ -759,14 +759,14 @@ TextPanel::try_to_load_analysis ()
setup_sensitivity ();
_analysis.reset ();
- shared_ptr<Content> content = _analysis_content.lock ();
+ auto content = _analysis_content.lock ();
if (!content) {
_loading_analysis = false;
setup_sensitivity ();
return;
}
- boost::filesystem::path const path = _parent->film()->subtitle_analysis_path(content);
+ auto const path = _parent->film()->subtitle_analysis_path(content);
if (!boost::filesystem::exists(path)) {
for (auto i: JobManager::instance()->get()) {
@@ -800,15 +800,15 @@ TextPanel::try_to_load_analysis ()
void
TextPanel::update_outline_subtitles_in_viewer ()
{
- shared_ptr<FilmViewer> fv = _parent->film_viewer().lock();
+ auto fv = _parent->film_viewer().lock();
if (!fv) {
return;
}
if (_analysis) {
- optional<dcpomatic::Rect<double> > rect = _analysis->bounding_box ();
+ auto rect = _analysis->bounding_box ();
if (rect) {
- shared_ptr<Content> content = _analysis_content.lock ();
+ auto content = _analysis_content.lock ();
DCPOMATIC_ASSERT (content);
rect->x += content->text.front()->x_offset();
rect->y += content->text.front()->y_offset();
@@ -835,7 +835,7 @@ TextPanel::clear_outline_subtitles ()
void
TextPanel::analysis_finished ()
{
- shared_ptr<Content> content = _analysis_content.lock ();
+ auto content = _analysis_content.lock ();
if (!content) {
_loading_analysis = false;
setup_sensitivity ();
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index 3294676fc..89f223956 100644
--- a/src/wx/timeline.cc
+++ b/src/wx/timeline.cc
@@ -112,7 +112,7 @@ Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film, w
_main_canvas->Bind (wxEVT_SCROLLWIN_PAGEDOWN, boost::bind (&Timeline::scrolled, this, _1));
_main_canvas->Bind (wxEVT_SCROLLWIN_THUMBTRACK, boost::bind (&Timeline::scrolled, this, _1));
- film_change (CHANGE_TYPE_DONE, Film::CONTENT);
+ film_change (ChangeType::DONE, Film::CONTENT);
SetMinSize (wxSize (640, 4 * pixels_per_track() + 96));
@@ -227,7 +227,7 @@ Timeline::paint_main ()
void
Timeline::film_change (ChangeType type, Film::Property p)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
@@ -277,7 +277,7 @@ Timeline::recreate_views ()
void
Timeline::film_content_change (ChangeType type, int property, bool frequent)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
@@ -403,7 +403,7 @@ Timeline::assign_tracks ()
}
/* Video on tracks 0 and maybe 1 (left and right eye) */
- if (cv->content()->video->frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) {
+ if (cv->content()->video->frame_type() == VideoFrameType::THREE_D_RIGHT) {
cv->set_track (1);
_tracks = max (_tracks, 2);
have_3d = true;
diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc
index 8258a81f9..bb84d6147 100644
--- a/src/wx/timeline_content_view.cc
+++ b/src/wx/timeline_content_view.cc
@@ -44,10 +44,10 @@ TimelineContentView::bbox () const
{
DCPOMATIC_ASSERT (_track);
- shared_ptr<const Film> film = _timeline.film ();
- shared_ptr<const Content> content = _content.lock ();
+ auto film = _timeline.film ();
+ auto content = _content.lock ();
if (!film || !content) {
- return dcpomatic::Rect<int> ();
+ return {};
}
return dcpomatic::Rect<int> (
@@ -86,7 +86,7 @@ TimelineContentView::set_track (int t)
void
TimelineContentView::unset_track ()
{
- _track = boost::optional<int> ();
+ _track = boost::optional<int>();
}
boost::optional<int>
@@ -100,8 +100,8 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
{
DCPOMATIC_ASSERT (_track);
- shared_ptr<const Film> film = _timeline.film ();
- shared_ptr<const Content> cont = content ();
+ auto film = _timeline.film ();
+ auto cont = content ();
if (!film || !cont) {
return;
}
@@ -119,7 +119,7 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
}
/* Outline */
- wxGraphicsPath path = gc->CreatePath ();
+ auto path = gc->CreatePath ();
path.MoveToPoint (time_x (position) + 2, y_pos (_track.get()) + 4);
path.AddLineToPoint (time_x (position + len) - 1, y_pos (_track.get()) + 4);
path.AddLineToPoint (time_x (position + len) - 1, y_pos (_track.get() + 1) - 4);
@@ -139,12 +139,12 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
/* Overlaps */
gc->SetBrush (*wxTheBrushList->FindOrCreateBrush (foreground_colour(), wxBRUSHSTYLE_CROSSDIAG_HATCH));
- for (list<dcpomatic::Rect<int> >::const_iterator i = overlaps.begin(); i != overlaps.end(); ++i) {
- gc->DrawRectangle (i->x, i->y + 4, i->width, i->height - 8);
+ for (auto const& i: overlaps) {
+ gc->DrawRectangle (i.x, i.y + 4, i.width, i.height - 8);
}
/* Label text */
- wxString lab = label ();
+ auto lab = label ();
wxDouble lab_width;
wxDouble lab_height;
wxDouble lab_descent;
@@ -166,7 +166,7 @@ TimelineContentView::y_pos (int t) const
void
TimelineContentView::content_change (ChangeType type, int p)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc
index 563c31f70..f15bf7bfc 100644
--- a/src/wx/timeline_dialog.cc
+++ b/src/wx/timeline_dialog.cc
@@ -57,7 +57,7 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film, weak_pt
, _film (film)
, _timeline (this, cp, film, viewer)
{
- wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
+ auto sizer = new wxBoxSizer (wxVERTICAL);
wxBitmap select (bitmap_path("select"), wxBITMAP_TYPE_PNG);
wxBitmap zoom (bitmap_path("zoom"), wxBITMAP_TYPE_PNG);
@@ -91,7 +91,7 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film, weak_pt
sizer->SetSizeHints (this);
_toolbar->ToggleTool ((int) Timeline::SNAP, _timeline.snap ());
- film_change (CHANGE_TYPE_DONE, Film::SEQUENCE);
+ film_change (ChangeType::DONE, Film::SEQUENCE);
_film_changed_connection = film->Change.connect (bind (&TimelineDialog::film_change, this, _1, _2));
}
@@ -99,11 +99,11 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film, weak_pt
void
TimelineDialog::film_change (ChangeType type, Film::Property p)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
- shared_ptr<Film> film = _film.lock ();
+ auto film = _film.lock ();
if (!film) {
return;
}
@@ -127,7 +127,7 @@ TimelineDialog::tool_clicked (wxCommandEvent& ev)
if (t == Timeline::SNAP) {
_timeline.set_snap (_toolbar->GetToolState ((int) t));
} else if (t == Timeline::SEQUENCE) {
- shared_ptr<Film> film = _film.lock ();
+ auto film = _film.lock ();
if (film) {
film->set_sequence (_toolbar->GetToolState ((int) t));
}
diff --git a/src/wx/video_view.cc b/src/wx/video_view.cc
index 42a7fe58b..3e21e709d 100644
--- a/src/wx/video_view.cc
+++ b/src/wx/video_view.cc
@@ -33,7 +33,7 @@ VideoView::VideoView (FilmViewer* viewer)
: _viewer (viewer)
, _state_timer ("viewer")
, _video_frame_rate (0)
- , _eyes (EYES_LEFT)
+ , _eyes (Eyes::LEFT)
, _three_d (false)
, _dropped (0)
, _errored (0)
@@ -84,7 +84,7 @@ VideoView::get_next_frame (bool non_blocking)
_player_video.first &&
_three_d &&
_eyes != _player_video.first->eyes() &&
- _player_video.first->eyes() != EYES_BOTH
+ _player_video.first->eyes() != Eyes::BOTH
);
if (_player_video.first && _player_video.first->error()) {
@@ -109,8 +109,8 @@ VideoView::time_until_next_frame () const
return optional<int>();
}
- dcpomatic::DCPTime const next = position() + one_video_frame();
- dcpomatic::DCPTime const time = _viewer->audio_time().get_value_or(position());
+ auto const next = position() + one_video_frame();
+ auto const time = _viewer->audio_time().get_value_or(position());
if (next < time) {
return 0;
}
@@ -128,7 +128,7 @@ VideoView::start ()
bool
VideoView::reset_metadata (shared_ptr<const Film> film, dcp::Size player_video_container_size)
{
- pair<shared_ptr<PlayerVideo>, dcpomatic::DCPTime> pv = player_video ();
+ auto pv = player_video ();
if (!pv.first) {
return false;
}