Split DCP panel up into general (at the top) then video/audio tabs.
[dcpomatic.git] / src / wx / content_panel.cc
index 13ae2d88ae6d9abd8e3bd5d0d00c9dff608daab0..b752a0e5fe3d41d5dfde90a4b275f3385e3a9e07 100644 (file)
@@ -38,6 +38,7 @@
 
 using std::list;
 using std::string;
+using std::cout;
 using boost::shared_ptr;
 using boost::weak_ptr;
 using boost::dynamic_pointer_cast;
@@ -399,7 +400,7 @@ ContentPanel::set_selection (weak_ptr<Content> wc)
 void
 ContentPanel::film_content_changed (int property)
 {
-       if (property == ContentProperty::PATH || property == ContentProperty::POSITION) {
+       if (property == ContentProperty::PATH || property == ContentProperty::POSITION || property == DCPContentProperty::CAN_BE_PLAYED) {
                setup ();
        }
                
@@ -425,19 +426,26 @@ ContentPanel::setup ()
        for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
                int const t = _content->GetItemCount ();
                bool const valid = (*i)->paths_valid ();
+               shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (*i);
+               bool const needs_kdm = dcp && !dcp->can_be_played ();
 
                string s = (*i)->summary ();
+               
                if (!valid) {
                        s = _("MISSING: ") + s;
                }
 
+               if (needs_kdm) {
+                       s = _("NEEDS KDM: ") + s;
+               }
+
                _content->InsertItem (t, std_to_wx (s));
 
                if ((*i)->summary() == selected_summary) {
                        _content->SetItemState (t, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
                }
 
-               if (!valid) {
+               if (!valid || needs_kdm) {
                        _content->SetItemTextColour (t, *wxRED);
                }
        }