diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-12-12 00:30:33 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-12-12 00:30:33 +0000 |
| commit | 3c414bf90d4cfcfe342c0b057b5134f72485fe32 (patch) | |
| tree | 543e3635577f04a58f1dc252fa0b888a4daeb005 | |
| parent | f851a375fc5bb9095def34c05a61f69e33139426 (diff) | |
Fix content properties (#1428).
| -rw-r--r-- | src/lib/content.cc | 6 | ||||
| -rw-r--r-- | src/lib/content.h | 4 | ||||
| -rw-r--r-- | src/lib/dcp_content.cc | 2 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 2 | ||||
| -rw-r--r-- | src/lib/image_content.cc | 4 | ||||
| -rw-r--r-- | src/lib/image_content.h | 2 | ||||
| -rw-r--r-- | src/lib/video_mxf_content.cc | 3 | ||||
| -rw-r--r-- | src/lib/video_mxf_content.h | 2 | ||||
| -rw-r--r-- | src/wx/content_menu.cc | 4 | ||||
| -rw-r--r-- | src/wx/content_properties_dialog.cc | 4 | ||||
| -rw-r--r-- | src/wx/content_properties_dialog.h | 5 |
11 files changed, 21 insertions, 17 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc index 1e73418b6..b288580cb 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -356,10 +356,10 @@ Content::path_summary () const /** @return a list of properties that might be interesting to the user */ list<UserProperty> -Content::user_properties () const +Content::user_properties (shared_ptr<const Film> film) const { list<UserProperty> p; - add_properties (p); + add_properties (film, p); return p; } @@ -423,7 +423,7 @@ Content::active_video_frame_rate (shared_ptr<const Film> film) const } void -Content::add_properties (list<UserProperty>& p) const +Content::add_properties (shared_ptr<const Film>, list<UserProperty>& p) const { p.push_back (UserProperty (UserProperty::GENERAL, _("Filename"), path(0).string ())); diff --git a/src/lib/content.h b/src/lib/content.h index bb66bc141..55cf4acae 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -180,7 +180,7 @@ public: _change_signals_frequent = f; } - std::list<UserProperty> user_properties () const; + std::list<UserProperty> user_properties (boost::shared_ptr<const Film> film) const; std::string calculate_digest () const; @@ -196,7 +196,7 @@ public: protected: - virtual void add_properties (std::list<UserProperty> &) const; + virtual void add_properties (boost::shared_ptr<const Film> film, std::list<UserProperty> &) const; /** _mutex which should be used to protect accesses, as examine * jobs can update content state in threads other than the main one. diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 419ffe69c..8a2e2050d 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -421,7 +421,7 @@ DCPContent::directories () const void DCPContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p) const { - Content::add_properties (p); + Content::add_properties (film, p); if (video) { video->add_properties (p); } diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index f4e4beba9..02d7a9ff6 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -507,7 +507,7 @@ FFmpegContent::set_default_colour_conversion () void FFmpegContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p) const { - Content::add_properties (p); + Content::add_properties (film, p); if (video) { video->add_properties (p); diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index 8902798a4..1515c8b76 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -182,8 +182,8 @@ ImageContent::set_default_colour_conversion () } void -ImageContent::add_properties (list<UserProperty>& p) const +ImageContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p) const { - Content::add_properties (p); + Content::add_properties (film, p); video->add_properties (p); } diff --git a/src/lib/image_content.h b/src/lib/image_content.h index e2a2ec366..959923a51 100644 --- a/src/lib/image_content.h +++ b/src/lib/image_content.h @@ -51,7 +51,7 @@ public: bool still () const; private: - void add_properties (std::list<UserProperty>& p) const; + void add_properties (boost::shared_ptr<const Film> film, std::list<UserProperty>& p) const; boost::optional<boost::filesystem::path> _path_to_scan; }; diff --git a/src/lib/video_mxf_content.cc b/src/lib/video_mxf_content.cc index 9d2af1a32..436046890 100644 --- a/src/lib/video_mxf_content.cc +++ b/src/lib/video_mxf_content.cc @@ -130,7 +130,8 @@ VideoMXFContent::approximate_length () const } void -VideoMXFContent::add_properties (list<UserProperty>& p) const +VideoMXFContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p) const { + Content::add_properties (film, p); video->add_properties (p); } diff --git a/src/lib/video_mxf_content.h b/src/lib/video_mxf_content.h index 25da0def4..27dce1fb7 100644 --- a/src/lib/video_mxf_content.h +++ b/src/lib/video_mxf_content.h @@ -41,7 +41,7 @@ public: void as_xml (xmlpp::Node* node, bool with_paths) const; DCPTime full_length (boost::shared_ptr<const Film> film) const; DCPTime approximate_length () const; - void add_properties (std::list<UserProperty>& p) const; + void add_properties (boost::shared_ptr<const Film> film, std::list<UserProperty>& p) const; static bool valid_mxf (boost::filesystem::path path); }; diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 017d2c659..19c54abcc 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -415,7 +415,9 @@ ContentMenu::ov () void ContentMenu::properties () { - ContentPropertiesDialog* d = new ContentPropertiesDialog (_parent, _content.front ()); + shared_ptr<Film> film = _film.lock (); + DCPOMATIC_ASSERT (film); + ContentPropertiesDialog* d = new ContentPropertiesDialog (_parent, film, _content.front()); d->ShowModal (); d->Destroy (); } diff --git a/src/wx/content_properties_dialog.cc b/src/wx/content_properties_dialog.cc index efc0e6ef1..7dcc6f8f1 100644 --- a/src/wx/content_properties_dialog.cc +++ b/src/wx/content_properties_dialog.cc @@ -34,11 +34,11 @@ using std::map; using boost::shared_ptr; using boost::dynamic_pointer_cast; -ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<Content> content) +ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<const Film> film, shared_ptr<Content> content) : TableDialog (parent, _("Content Properties"), 2, 1, false) { map<UserProperty::Category, list<UserProperty> > grouped; - BOOST_FOREACH (UserProperty i, content->user_properties()) { + BOOST_FOREACH (UserProperty i, content->user_properties(film)) { if (grouped.find(i.category) == grouped.end()) { grouped[i.category] = list<UserProperty> (); } diff --git a/src/wx/content_properties_dialog.h b/src/wx/content_properties_dialog.h index 92aa5c6d7..5d0cd4630 100644 --- a/src/wx/content_properties_dialog.h +++ b/src/wx/content_properties_dialog.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2015-2016 Carl Hetherington <cth@carlh.net> + Copyright (C) 2015-2018 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -25,12 +25,13 @@ #include <map> class Content; +class Film; class UserProperty; class ContentPropertiesDialog : public TableDialog { public: - ContentPropertiesDialog (wxWindow* parent, boost::shared_ptr<Content> content); + ContentPropertiesDialog (wxWindow* parent, boost::shared_ptr<const Film> film, boost::shared_ptr<Content> content); private: void maybe_add_group (std::map<UserProperty::Category, std::list<UserProperty> > const & groups, UserProperty::Category category); |
