Update content list when selected CPL changes in DCP content.
authorCarl Hetherington <cth@carlh.net>
Fri, 14 Oct 2016 22:38:16 +0000 (23:38 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 14 Oct 2016 22:38:16 +0000 (23:38 +0100)
src/lib/dcp_content.cc
src/lib/dcp_content.h
src/wx/content_panel.cc

index 0d36118e716adbd720bedfb46655a34476d70dcb..dc32a243e89245221ec37b9906626bf31a39d6b3 100644 (file)
@@ -59,6 +59,7 @@ int const DCPContentProperty::NEEDS_KDM          = 601;
 int const DCPContentProperty::REFERENCE_VIDEO    = 602;
 int const DCPContentProperty::REFERENCE_AUDIO    = 603;
 int const DCPContentProperty::REFERENCE_SUBTITLE = 604;
+int const DCPContentProperty::NAME               = 605;
 
 DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p)
        : Content (film)
@@ -138,6 +139,7 @@ DCPContent::examine (shared_ptr<Job> job)
 {
        bool const needed_assets = needs_assets ();
        bool const needed_kdm = needs_kdm ();
+       string const old_name = name ();
 
        job->set_progress_unknown ();
        Content::examine (job);
@@ -180,6 +182,10 @@ DCPContent::examine (shared_ptr<Job> job)
                signal_changed (DCPContentProperty::NEEDS_KDM);
        }
 
+       if (old_name != name ()) {
+               signal_changed (DCPContentProperty::NAME);
+       }
+
        video->set_frame_type (_three_d ? VIDEO_FRAME_TYPE_3D : VIDEO_FRAME_TYPE_2D);
 }
 
index 21b654c96040d756ad37888f427ca49ccc1f91bd..1212b8b0fbf3ff79f3681d10b8c0fd6044b5b516 100644 (file)
@@ -37,6 +37,7 @@ public:
        static int const REFERENCE_VIDEO;
        static int const REFERENCE_AUDIO;
        static int const REFERENCE_SUBTITLE;
+       static int const NAME;
 };
 
 class ContentPart;
@@ -135,6 +136,11 @@ private:
                std::list<std::string>& why_not
                ) const;
 
+       std::string name () const {
+               boost::mutex::scoped_lock lm (_mutex);
+               return _name;
+       }
+
        std::string _name;
        /** true if our DCP is encrypted */
        bool _encrypted;
index 7bea5168757766a9c93c3fd6edae248c1fde4001..ea1d507661ec96594a7f4726eb9df9b977b90b1d 100644 (file)
@@ -481,7 +481,13 @@ ContentPanel::set_selection (ContentList cl)
 void
 ContentPanel::film_content_changed (int property)
 {
-       if (property == ContentProperty::PATH || property == DCPContentProperty::NEEDS_ASSETS || property == DCPContentProperty::NEEDS_KDM) {
+       if (
+               property == ContentProperty::PATH ||
+               property == DCPContentProperty::NEEDS_ASSETS ||
+               property == DCPContentProperty::NEEDS_KDM ||
+               property == DCPContentProperty::NAME
+               ) {
+
                setup ();
        }