/** @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;
}
}
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 ()));
_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;
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.
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);
}
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);
}
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);
}
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;
};
}
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);
}
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);
};
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 ();
}
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> ();
}
/*
- 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.
#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);