summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-11-08 00:59:42 +0100
committerCarl Hetherington <cth@carlh.net>2023-11-20 07:34:23 +0100
commit83a948956916abb7b2c13c25141323d326b38708 (patch)
tree83bbeba8d94aa9c49dc248fdf54ff2a854f64d87 /src/wx
parentbb3a9a12116a4b2a5bc1fef38e73853f576a773a (diff)
Cleanup: handle Filter objects by value rather than by reference.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/content_advanced_dialog.cc2
-rw-r--r--src/wx/content_advanced_dialog.h6
-rw-r--r--src/wx/filter_dialog.cc24
-rw-r--r--src/wx/filter_dialog.h8
-rw-r--r--src/wx/simple_video_view.cc2
5 files changed, 21 insertions, 21 deletions
diff --git a/src/wx/content_advanced_dialog.cc b/src/wx/content_advanced_dialog.cc
index 27f34e19a..f3f59eb52 100644
--- a/src/wx/content_advanced_dialog.cc
+++ b/src/wx/content_advanced_dialog.cc
@@ -187,7 +187,7 @@ ContentAdvancedDialog::edit_filters ()
void
-ContentAdvancedDialog::filters_changed (vector<Filter const *> filters)
+ContentAdvancedDialog::filters_changed(vector<Filter> const& filters)
{
_filters_list = filters;
setup_filters ();
diff --git a/src/wx/content_advanced_dialog.h b/src/wx/content_advanced_dialog.h
index 517ad04e5..8f27fd822 100644
--- a/src/wx/content_advanced_dialog.h
+++ b/src/wx/content_advanced_dialog.h
@@ -42,7 +42,7 @@ public:
bool ignore_video() const;
- std::vector<Filter const*> filters() {
+ std::vector<Filter> filters() {
return _filters_list;
}
@@ -51,7 +51,7 @@ public:
private:
void edit_filters ();
- void filters_changed (std::vector<Filter const *> filters);
+ void filters_changed(std::vector<Filter> const& filters);
void setup_filters ();
void set_video_frame_rate ();
void video_frame_rate_changed ();
@@ -60,7 +60,7 @@ private:
std::shared_ptr<Content> _content;
bool _filters_allowed = false;
- std::vector<Filter const*> _filters_list;
+ std::vector<Filter> _filters_list;
wxStaticText* _filters;
wxButton* _filters_button;
diff --git a/src/wx/filter_dialog.cc b/src/wx/filter_dialog.cc
index f9ba06eae..517978c74 100644
--- a/src/wx/filter_dialog.cc
+++ b/src/wx/filter_dialog.cc
@@ -36,7 +36,7 @@ using namespace std;
using boost::bind;
-FilterDialog::FilterDialog (wxWindow* parent, vector<Filter const *> const & active)
+FilterDialog::FilterDialog(wxWindow* parent, vector<Filter> const& active)
: wxDialog (parent, wxID_ANY, wxString(_("Filters")))
{
auto panel = new wxPanel (this);
@@ -44,29 +44,29 @@ FilterDialog::FilterDialog (wxWindow* parent, vector<Filter const *> const & act
auto filters = Filter::all ();
- map<string, list<Filter const *>> categories;
+ map<string, list<Filter>> categories;
for (auto i: filters) {
- auto j = categories.find (i->category());
+ auto j = categories.find(i.category());
if (j == categories.end ()) {
- categories[i->category()] = { i };
+ categories[i.category()] = { i };
} else {
j->second.push_back (i);
}
}
- for (auto const& i: categories) {
- auto c = new StaticText (panel, std_to_wx(i.first));
+ for (auto const& category: categories) {
+ auto c = new StaticText(panel, std_to_wx(category.first));
auto font = c->GetFont();
font.SetWeight(wxFONTWEIGHT_BOLD);
c->SetFont(font);
sizer->Add (c, 1, wxTOP | wxBOTTOM, DCPOMATIC_SIZER_GAP);
- for (auto j: i.second) {
- auto b = new CheckBox(panel, std_to_wx(j->name()));
- bool const a = find (active.begin(), active.end(), j) != active.end();
+ for (auto const& filter: category.second) {
+ auto b = new CheckBox(panel, std_to_wx(filter.name()));
+ bool const a = find(active.begin(), active.end(), filter) != active.end();
b->SetValue (a);
- _filters[j] = b;
+ _filters[filter] = b;
b->bind(&FilterDialog::filter_toggled, this);
sizer->Add (b);
}
@@ -95,10 +95,10 @@ FilterDialog::filter_toggled ()
}
-vector<Filter const*>
+vector<Filter>
FilterDialog::active () const
{
- vector<Filter const *> active;
+ vector<Filter> active;
for (auto const& i: _filters) {
if (i.second->IsChecked()) {
active.push_back(i.first);
diff --git a/src/wx/filter_dialog.h b/src/wx/filter_dialog.h
index 44dbb502d..aaa43c3e4 100644
--- a/src/wx/filter_dialog.h
+++ b/src/wx/filter_dialog.h
@@ -41,14 +41,14 @@ class Filter;
class FilterDialog : public wxDialog
{
public:
- FilterDialog (wxWindow *, std::vector<Filter const *> const &);
+ FilterDialog(wxWindow *, std::vector<Filter> const&);
- boost::signals2::signal<void (std::vector<Filter const *>)> ActiveChanged;
+ boost::signals2::signal<void (std::vector<Filter>)> ActiveChanged;
private:
void active_changed ();
void filter_toggled ();
- std::vector<Filter const *> active () const;
+ std::vector<Filter> active() const;
- std::map<Filter const *, wxCheckBox *> _filters;
+ std::map<Filter, wxCheckBox *> _filters;
};
diff --git a/src/wx/simple_video_view.cc b/src/wx/simple_video_view.cc
index 85d6b1036..8524c1fe9 100644
--- a/src/wx/simple_video_view.cc
+++ b/src/wx/simple_video_view.cc
@@ -49,7 +49,7 @@ using namespace dcpomatic;
SimpleVideoView::SimpleVideoView (FilmViewer* viewer, wxWindow* parent)
: VideoView (viewer)
, _rec2020_filter("convert", "convert", "", "colorspace=all=bt709:iall=bt2020")
- , _rec2020_filter_graph({ &_rec2020_filter }, dcp::Fraction(24, 1))
+ , _rec2020_filter_graph({ _rec2020_filter }, dcp::Fraction(24, 1))
{
_panel = new wxPanel (parent);