summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-01-31 23:47:14 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-31 23:47:14 +0100
commite0255a64d22440d718e5512f34a4f21f0d37a21b (patch)
tree61927018d28794c7c32c238bc37259bfddb2f01c /src/wx
parent8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8 (diff)
Use enum class for Film::Property.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/audio_dialog.cc10
-rw-r--r--src/wx/audio_dialog.h2
-rw-r--r--src/wx/audio_panel.cc16
-rw-r--r--src/wx/content_panel.cc8
-rw-r--r--src/wx/controls.cc4
-rw-r--r--src/wx/dcp_panel.cc80
-rw-r--r--src/wx/dcp_panel.h13
-rw-r--r--src/wx/film_editor.cc2
-rw-r--r--src/wx/film_viewer.cc12
-rw-r--r--src/wx/hints_dialog.h4
-rw-r--r--src/wx/smpte_metadata_dialog.cc44
-rw-r--r--src/wx/subtitle_appearance_dialog.h1
-rw-r--r--src/wx/text_panel.cc2
-rw-r--r--src/wx/timeline.cc6
-rw-r--r--src/wx/timeline_content_view.cc1
-rw-r--r--src/wx/timeline_content_view.h5
-rw-r--r--src/wx/timeline_dialog.cc4
-rw-r--r--src/wx/timing_panel.cc2
-rw-r--r--src/wx/video_panel.cc10
19 files changed, 117 insertions, 109 deletions
diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc
index b8c7f7b73..c27d9f061 100644
--- a/src/wx/audio_dialog.cc
+++ b/src/wx/audio_dialog.cc
@@ -101,7 +101,7 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, weak_ptr<Film
wxBoxSizer* right = new wxBoxSizer (wxVERTICAL);
{
- wxStaticText* m = new StaticText (this, _("Channels"));
+ auto m = new StaticText (this, _("Channels"));
m->SetFont (subheading_font);
right->Add (m, 1, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, 16);
}
@@ -116,7 +116,7 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, weak_ptr<Film
show_or_hide_channel_checkboxes ();
{
- wxStaticText* m = new StaticText (this, _("Type"));
+ auto m = new StaticText (this, _("Type"));
m->SetFont (subheading_font);
right->Add (m, 1, wxALIGN_CENTER_VERTICAL | wxTOP, 16);
}
@@ -133,7 +133,7 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, weak_ptr<Film
}
{
- wxStaticText* m = new StaticText (this, _("Smoothing"));
+ auto m = new StaticText (this, _("Smoothing"));
m->SetFont (subheading_font);
right->Add (m, 1, wxALIGN_CENTER_VERTICAL | wxTOP, 16);
}
@@ -312,13 +312,13 @@ AudioDialog::channel_clicked (wxCommandEvent& ev)
}
void
-AudioDialog::film_change (ChangeType type, int p)
+AudioDialog::film_change (ChangeType type, Film::Property p)
{
if (type != ChangeType::DONE) {
return;
}
- if (p == Film::AUDIO_CHANNELS) {
+ if (p == Film::Property::AUDIO_CHANNELS) {
auto film = _film.lock ();
if (film) {
_channels = film->audio_channels ();
diff --git a/src/wx/audio_dialog.h b/src/wx/audio_dialog.h
index a94e98e32..12dd0cadf 100644
--- a/src/wx/audio_dialog.h
+++ b/src/wx/audio_dialog.h
@@ -41,7 +41,7 @@ public:
void set_cursor (boost::optional<dcpomatic::DCPTime> time, boost::optional<float> db);
private:
- void film_change (ChangeType, int);
+ void film_change (ChangeType, Film::Property);
void content_change (ChangeType, int);
void channel_clicked (wxCommandEvent &);
void type_clicked (wxCommandEvent &);
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc
index f29704b54..59c9cd2a8 100644
--- a/src/wx/audio_panel.cc
+++ b/src/wx/audio_panel.cc
@@ -104,9 +104,9 @@ AudioPanel::AudioPanel (ContentPanel* p)
_delay->wrapped()->SetRange (-1000, 1000);
content_selection_changed ();
- film_changed (Film::AUDIO_CHANNELS);
- film_changed (Film::VIDEO_FRAME_RATE);
- film_changed (Film::REEL_TYPE);
+ film_changed (Film::Property::AUDIO_CHANNELS);
+ film_changed (Film::Property::VIDEO_FRAME_RATE);
+ film_changed (Film::Property::REEL_TYPE);
_reference->Bind (wxEVT_CHECKBOX, boost::bind (&AudioPanel::reference_clicked, this));
_show->Bind (wxEVT_BUTTON, boost::bind (&AudioPanel::show_clicked, this));
@@ -168,16 +168,16 @@ AudioPanel::film_changed (Film::Property property)
}
switch (property) {
- case Film::AUDIO_CHANNELS:
- case Film::AUDIO_PROCESSOR:
+ case Film::Property::AUDIO_CHANNELS:
+ case Film::Property::AUDIO_PROCESSOR:
_mapping->set_output_channels (_parent->film()->audio_output_names ());
setup_peak ();
break;
- case Film::VIDEO_FRAME_RATE:
+ case Film::Property::VIDEO_FRAME_RATE:
setup_description ();
break;
- case Film::REEL_TYPE:
- case Film::INTEROP:
+ case Film::Property::REEL_TYPE:
+ case Film::Property::INTEROP:
setup_sensitivity ();
break;
default:
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index a06791d4d..d54f3dc6b 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -238,8 +238,8 @@ void
ContentPanel::film_changed (Film::Property p)
{
switch (p) {
- case Film::CONTENT:
- case Film::CONTENT_ORDER:
+ case Film::Property::CONTENT:
+ case Film::Property::CONTENT_ORDER:
setup ();
break;
default:
@@ -587,8 +587,8 @@ ContentPanel::set_film (shared_ptr<Film> film)
_film = film;
- film_changed (Film::CONTENT);
- film_changed (Film::AUDIO_CHANNELS);
+ film_changed (Film::Property::CONTENT);
+ film_changed (Film::Property::AUDIO_CHANNELS);
if (_film) {
check_selection ();
diff --git a/src/wx/controls.cc b/src/wx/controls.cc
index 311343400..9eae77495 100644
--- a/src/wx/controls.cc
+++ b/src/wx/controls.cc
@@ -408,11 +408,11 @@ void
Controls::film_change (ChangeType type, Film::Property p)
{
if (type == ChangeType::DONE) {
- if (p == Film::CONTENT) {
+ if (p == Film::Property::CONTENT) {
setup_sensitivity ();
update_position_label ();
update_position_slider ();
- } else if (p == Film::THREE_D) {
+ } else if (p == Film::Property::THREE_D) {
setup_sensitivity ();
}
}
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index cf4d5d3fe..b925213ad 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -334,34 +334,34 @@ DCPPanel::metadata_clicked ()
}
void
-DCPPanel::film_changed (int p)
+DCPPanel::film_changed (Film::Property p)
{
switch (p) {
- case Film::NONE:
+ case Film::Property::NONE:
break;
- case Film::CONTAINER:
+ case Film::Property::CONTAINER:
setup_container ();
break;
- case Film::NAME:
+ case Film::Property::NAME:
checked_set (_name, _film->name());
setup_dcp_name ();
break;
- case Film::DCP_CONTENT_TYPE:
+ case Film::Property::DCP_CONTENT_TYPE:
checked_set (_dcp_content_type, DCPContentType::as_index (_film->dcp_content_type ()));
setup_dcp_name ();
break;
- case Film::ENCRYPTED:
+ case Film::Property::ENCRYPTED:
checked_set (_encrypted, _film->encrypted ());
break;
- case Film::RESOLUTION:
+ case Film::Property::RESOLUTION:
checked_set (_resolution, _film->resolution() == Resolution::TWO_K ? 0 : 1);
setup_container ();
setup_dcp_name ();
break;
- case Film::J2K_BANDWIDTH:
+ case Film::Property::J2K_BANDWIDTH:
checked_set (_j2k_bandwidth, _film->j2k_bandwidth() / 1000000);
break;
- case Film::USE_ISDCF_NAME:
+ case Film::Property::USE_ISDCF_NAME:
{
checked_set (_use_isdcf_name, _film->use_isdcf_name ());
if (_film->use_isdcf_name()) {
@@ -378,11 +378,11 @@ DCPPanel::film_changed (int p)
_edit_isdcf_button->Enable (_film->use_isdcf_name ());
break;
}
- case Film::ISDCF_METADATA:
- case Film::SUBTITLE_LANGUAGES:
+ case Film::Property::ISDCF_METADATA:
+ case Film::Property::SUBTITLE_LANGUAGES:
setup_dcp_name ();
break;
- case Film::VIDEO_FRAME_RATE:
+ case Film::Property::VIDEO_FRAME_RATE:
{
bool done = false;
for (unsigned int i = 0; i < _frame_rate_choice->GetCount(); ++i) {
@@ -403,7 +403,7 @@ DCPPanel::film_changed (int p)
setup_dcp_name ();
break;
}
- case Film::AUDIO_CHANNELS:
+ case Film::Property::AUDIO_CHANNELS:
if (_film->audio_channels () < minimum_allowed_audio_channels ()) {
_film->set_audio_channels (minimum_allowed_audio_channels ());
} else {
@@ -411,35 +411,35 @@ DCPPanel::film_changed (int p)
setup_dcp_name ();
}
break;
- case Film::THREE_D:
+ case Film::Property::THREE_D:
checked_set (_three_d, _film->three_d ());
setup_dcp_name ();
break;
- case Film::REENCODE_J2K:
+ case Film::Property::REENCODE_J2K:
checked_set (_reencode_j2k, _film->reencode_j2k());
break;
- case Film::INTEROP:
+ case Film::Property::INTEROP:
checked_set (_standard, _film->interop() ? 1 : 0);
setup_dcp_name ();
_markers->Enable (!_film->interop());
break;
- case Film::AUDIO_PROCESSOR:
+ case Film::Property::AUDIO_PROCESSOR:
if (_film->audio_processor ()) {
checked_set (_audio_processor, _film->audio_processor()->id());
} else {
checked_set (_audio_processor, 0);
}
setup_audio_channels_choice (_audio_channels, minimum_allowed_audio_channels ());
- film_changed (Film::AUDIO_CHANNELS);
+ film_changed (Film::Property::AUDIO_CHANNELS);
break;
- case Film::REEL_TYPE:
+ case Film::Property::REEL_TYPE:
checked_set (_reel_type, static_cast<int>(_film->reel_type()));
_reel_length->Enable (_film->reel_type() == ReelType::BY_LENGTH);
break;
- case Film::REEL_LENGTH:
+ case Film::Property::REEL_LENGTH:
checked_set (_reel_length, _film->reel_length() / 1000000000LL);
break;
- case Film::CONTENT:
+ case Film::Property::CONTENT:
setup_dcp_name ();
setup_sensitivity ();
break;
@@ -547,24 +547,24 @@ DCPPanel::set_film (shared_ptr<Film> film)
return;
}
- film_changed (Film::NAME);
- film_changed (Film::USE_ISDCF_NAME);
- film_changed (Film::CONTENT);
- film_changed (Film::DCP_CONTENT_TYPE);
- film_changed (Film::CONTAINER);
- film_changed (Film::RESOLUTION);
- film_changed (Film::ENCRYPTED);
- film_changed (Film::J2K_BANDWIDTH);
- film_changed (Film::ISDCF_METADATA);
- film_changed (Film::VIDEO_FRAME_RATE);
- film_changed (Film::AUDIO_CHANNELS);
- film_changed (Film::SEQUENCE);
- film_changed (Film::THREE_D);
- film_changed (Film::INTEROP);
- film_changed (Film::AUDIO_PROCESSOR);
- film_changed (Film::REEL_TYPE);
- film_changed (Film::REEL_LENGTH);
- film_changed (Film::REENCODE_J2K);
+ film_changed (Film::Property::NAME);
+ film_changed (Film::Property::USE_ISDCF_NAME);
+ film_changed (Film::Property::CONTENT);
+ film_changed (Film::Property::DCP_CONTENT_TYPE);
+ film_changed (Film::Property::CONTAINER);
+ film_changed (Film::Property::RESOLUTION);
+ film_changed (Film::Property::ENCRYPTED);
+ film_changed (Film::Property::J2K_BANDWIDTH);
+ film_changed (Film::Property::ISDCF_METADATA);
+ film_changed (Film::Property::VIDEO_FRAME_RATE);
+ film_changed (Film::Property::AUDIO_CHANNELS);
+ film_changed (Film::Property::SEQUENCE);
+ film_changed (Film::Property::THREE_D);
+ film_changed (Film::Property::INTEROP);
+ film_changed (Film::Property::AUDIO_PROCESSOR);
+ film_changed (Film::Property::REEL_TYPE);
+ film_changed (Film::Property::REEL_LENGTH);
+ film_changed (Film::Property::REENCODE_J2K);
set_general_sensitivity(static_cast<bool>(_film));
}
@@ -687,7 +687,7 @@ DCPPanel::config_changed (Config::Property p)
_audio_processor->Clear ();
add_audio_processors ();
if (_film) {
- film_changed (Film::AUDIO_PROCESSOR);
+ film_changed (Film::Property::AUDIO_PROCESSOR);
}
}
}
diff --git a/src/wx/dcp_panel.h b/src/wx/dcp_panel.h
index cce97a2dc..9b362a26c 100644
--- a/src/wx/dcp_panel.h
+++ b/src/wx/dcp_panel.h
@@ -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.
@@ -18,8 +18,10 @@
*/
+
#include "lib/config.h"
-#include <boost/noncopyable.hpp>
+#include "lib/film.h"
+
class wxNotebook;
class wxPanel;
@@ -41,15 +43,18 @@ class Film;
class FilmViewer;
class Ratio;
-class DCPPanel : public boost::noncopyable
+class DCPPanel
{
public:
DCPPanel (wxNotebook *, std::shared_ptr<Film>, std::weak_ptr<FilmViewer> viewer);
+ DCPPanel (DCPPanel const&) = delete;
+ DCPPanel& operator= (DCPPanel const&) = delete;
+
void set_film (std::shared_ptr<Film>);
void set_general_sensitivity (bool);
- void film_changed (int);
+ void film_changed (Film::Property);
void film_content_changed (int);
wxPanel* panel () const {
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index 47a6358cc..767676fff 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -86,7 +86,7 @@ FilmEditor::film_change (ChangeType type, Film::Property p)
_content_panel->film_changed (p);
_dcp_panel->film_changed (p);
- if (p == Film::CONTENT && !_film->content().empty ()) {
+ if (p == Film::Property::CONTENT && !_film->content().empty()) {
/* Select newly-added content */
_content_panel->set_selection (_film->content().back ());
}
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index f31553239..bfacbdfe1 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 (ChangeType::DONE, Film::VIDEO_FRAME_RATE);
- film_change (ChangeType::DONE, Film::THREE_D);
+ film_change (ChangeType::DONE, Film::Property::VIDEO_FRAME_RATE);
+ film_change (ChangeType::DONE, Film::Property::THREE_D);
film_length_change ();
/* Keep about 1 second's worth of history samples */
@@ -411,13 +411,13 @@ FilmViewer::film_change (ChangeType type, Film::Property p)
return;
}
- if (p == Film::AUDIO_CHANNELS) {
+ if (p == Film::Property::AUDIO_CHANNELS) {
recreate_butler ();
- } else if (p == Film::VIDEO_FRAME_RATE) {
+ } else if (p == Film::Property::VIDEO_FRAME_RATE) {
_video_view->set_video_frame_rate (_film->video_frame_rate());
- } else if (p == Film::THREE_D) {
+ } else if (p == Film::Property::THREE_D) {
_video_view->set_three_d (_film->three_d());
- } else if (p == Film::CONTENT) {
+ } else if (p == Film::Property::CONTENT) {
_closed_captions_dialog->update_tracks (_film);
}
}
diff --git a/src/wx/hints_dialog.h b/src/wx/hints_dialog.h
index 4c4449a26..9124d5c13 100644
--- a/src/wx/hints_dialog.h
+++ b/src/wx/hints_dialog.h
@@ -18,13 +18,15 @@
*/
-#include "lib/types.h"
+
+#include "lib/change_signaller.h"
#include "lib/warnings.h"
DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
DCPOMATIC_ENABLE_WARNINGS
#include <boost/signals2.hpp>
+
class wxRichTextCtrl;
class Film;
class Hints;
diff --git a/src/wx/smpte_metadata_dialog.cc b/src/wx/smpte_metadata_dialog.cc
index b8a1184e0..64afcac5c 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 (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);
+ film_changed (ChangeType::DONE, Film::Property::NAME_LANGUAGE);
+ film_changed (ChangeType::DONE, Film::Property::RELEASE_TERRITORY);
+ film_changed (ChangeType::DONE, Film::Property::VERSION_NUMBER);
+ film_changed (ChangeType::DONE, Film::Property::STATUS);
+ film_changed (ChangeType::DONE, Film::Property::CHAIN);
+ film_changed (ChangeType::DONE, Film::Property::DISTRIBUTOR);
+ film_changed (ChangeType::DONE, Film::Property::FACILITY);
+ film_changed (ChangeType::DONE, Film::Property::CONTENT_VERSIONS);
+ film_changed (ChangeType::DONE, Film::Property::LUMINANCE);
+ film_changed (ChangeType::DONE, Film::Property::SUBTITLE_LANGUAGES);
setup_sensitivity ();
}
@@ -266,13 +266,13 @@ SMPTEMetadataDialog::film_changed (ChangeType type, Film::Property property)
return;
}
- if (property == Film::NAME_LANGUAGE) {
+ if (property == Film::Property::NAME_LANGUAGE) {
_name_language->set (film()->name_language());
- } else if (property == Film::RELEASE_TERRITORY) {
+ } else if (property == Film::Property::RELEASE_TERRITORY) {
checked_set (_release_territory, std_to_wx(*dcp::LanguageTag::get_subtag_description(dcp::LanguageTag::SubtagType::REGION, film()->release_territory().subtag())));
- } else if (property == Film::VERSION_NUMBER) {
+ } else if (property == Film::Property::VERSION_NUMBER) {
checked_set (_version_number, film()->version_number());
- } else if (property == Film::STATUS) {
+ } else if (property == Film::Property::STATUS) {
switch (film()->status()) {
case dcp::Status::TEMP:
checked_set (_status, 0);
@@ -284,13 +284,13 @@ SMPTEMetadataDialog::film_changed (ChangeType type, Film::Property property)
checked_set (_status, 2);
break;
}
- } else if (property == Film::CHAIN) {
+ } else if (property == Film::Property::CHAIN) {
checked_set (_chain, film()->chain());
- } else if (property == Film::DISTRIBUTOR) {
+ } else if (property == Film::Property::DISTRIBUTOR) {
checked_set (_distributor, film()->distributor());
- } else if (property == Film::FACILITY) {
+ } else if (property == Film::Property::FACILITY) {
checked_set (_facility, film()->facility());
- } else if (property == Film::LUMINANCE) {
+ } else if (property == Film::Property::LUMINANCE) {
checked_set (_luminance_value, film()->luminance().value());
switch (film()->luminance().unit()) {
case dcp::Luminance::Unit::CANDELA_PER_SQUARE_METRE:
@@ -300,7 +300,7 @@ SMPTEMetadataDialog::film_changed (ChangeType type, Film::Property property)
checked_set (_luminance_unit, 1);
break;
}
- } else if (property == Film::SUBTITLE_LANGUAGES) {
+ } else if (property == Film::Property::SUBTITLE_LANGUAGES) {
vector<dcp::LanguageTag> languages = film()->subtitle_languages();
checked_set (_enable_main_subtitle_language, !languages.empty());
if (!languages.empty()) {
@@ -357,11 +357,11 @@ SMPTEMetadataDialog::audio_language_changed (dcp::LanguageTag tag)
void
SMPTEMetadataDialog::edit_release_territory ()
{
- RegionSubtagDialog* d = new RegionSubtagDialog(this, film()->release_territory());
+ auto d = new RegionSubtagDialog(this, film()->release_territory());
d->ShowModal ();
- optional<dcp::LanguageTag::RegionSubtag> tag = d->get();
+ auto tag = d->get();
if (tag) {
- film()->set_release_territory (*tag);
+ film()->set_release_territory(*tag);
}
d->Destroy ();
}
diff --git a/src/wx/subtitle_appearance_dialog.h b/src/wx/subtitle_appearance_dialog.h
index 299b3c70a..daaccf08f 100644
--- a/src/wx/subtitle_appearance_dialog.h
+++ b/src/wx/subtitle_appearance_dialog.h
@@ -19,6 +19,7 @@
*/
#include "timecode.h"
+#include "lib/change_signaller.h"
#include "lib/rgba.h"
#include "lib/warnings.h"
DCPOMATIC_DISABLE_WARNINGS
diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc
index dec58f0cd..0a35e6497 100644
--- a/src/wx/text_panel.cc
+++ b/src/wx/text_panel.cc
@@ -360,7 +360,7 @@ TextPanel::dcp_track_changed ()
void
TextPanel::film_changed (Film::Property property)
{
- if (property == Film::CONTENT || property == Film::REEL_TYPE || property == Film::INTEROP) {
+ if (property == Film::Property::CONTENT || property == Film::Property::REEL_TYPE || property == Film::Property::INTEROP) {
setup_sensitivity ();
}
}
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index 89f223956..60200d8bb 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 (ChangeType::DONE, Film::CONTENT);
+ film_change (ChangeType::DONE, Film::Property::CONTENT);
SetMinSize (wxSize (640, 4 * pixels_per_track() + 96));
@@ -231,10 +231,10 @@ Timeline::film_change (ChangeType type, Film::Property p)
return;
}
- if (p == Film::CONTENT || p == Film::REEL_TYPE || p == Film::REEL_LENGTH) {
+ if (p == Film::Property::CONTENT || p == Film::Property::REEL_TYPE || p == Film::Property::REEL_LENGTH) {
ensure_ui_thread ();
recreate_views ();
- } else if (p == Film::CONTENT_ORDER) {
+ } else if (p == Film::Property::CONTENT_ORDER) {
Refresh ();
}
}
diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc
index bb84d6147..677b83bdd 100644
--- a/src/wx/timeline_content_view.cc
+++ b/src/wx/timeline_content_view.cc
@@ -34,7 +34,6 @@ using namespace boost::placeholders;
TimelineContentView::TimelineContentView (Timeline& tl, shared_ptr<Content> c)
: TimelineView (tl)
, _content (c)
- , _selected (false)
{
_content_connection = c->Change.connect (bind (&TimelineContentView::content_change, this, _1, _3));
}
diff --git a/src/wx/timeline_content_view.h b/src/wx/timeline_content_view.h
index fcc068064..e9b294854 100644
--- a/src/wx/timeline_content_view.h
+++ b/src/wx/timeline_content_view.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -21,6 +21,7 @@
#ifndef DCPOMATIC_TIMELINE_CONTENT_VIEW_H
#define DCPOMATIC_TIMELINE_CONTENT_VIEW_H
+#include "lib/change_signaller.h"
#include "lib/types.h"
#include "lib/warnings.h"
#include "timeline_view.h"
@@ -64,7 +65,7 @@ private:
void content_change (ChangeType type, int p);
boost::optional<int> _track;
- bool _selected;
+ bool _selected = false;
boost::signals2::scoped_connection _content_connection;
};
diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc
index f15bf7bfc..77acb9758 100644
--- a/src/wx/timeline_dialog.cc
+++ b/src/wx/timeline_dialog.cc
@@ -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 (ChangeType::DONE, Film::SEQUENCE);
+ film_change (ChangeType::DONE, Film::Property::SEQUENCE);
_film_changed_connection = film->Change.connect (bind (&TimelineDialog::film_change, this, _1, _2));
}
@@ -108,7 +108,7 @@ TimelineDialog::film_change (ChangeType type, Film::Property p)
return;
}
- if (p == Film::SEQUENCE) {
+ if (p == Film::Property::SEQUENCE) {
_toolbar->ToggleTool ((int) Timeline::SEQUENCE, film->sequence ());
}
}
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc
index ecf55640d..f251e3c93 100644
--- a/src/wx/timing_panel.cc
+++ b/src/wx/timing_panel.cc
@@ -425,7 +425,7 @@ TimingPanel::content_selection_changed ()
void
TimingPanel::film_changed (Film::Property p)
{
- if (p == Film::VIDEO_FRAME_RATE) {
+ if (p == Film::Property::VIDEO_FRAME_RATE) {
update_full_length ();
update_play_length ();
}
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index b9c09cc69..6cb3bfc87 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -326,14 +326,14 @@ void
VideoPanel::film_changed (Film::Property property)
{
switch (property) {
- case Film::VIDEO_FRAME_RATE:
- case Film::CONTAINER:
- case Film::RESOLUTION:
+ case Film::Property::VIDEO_FRAME_RATE:
+ case Film::Property::CONTAINER:
+ case Film::Property::RESOLUTION:
setup_description ();
setup_sensitivity ();
break;
- case Film::REEL_TYPE:
- case Film::INTEROP:
+ case Film::Property::REEL_TYPE:
+ case Film::Property::INTEROP:
setup_sensitivity ();
break;
default: