diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-08-23 00:27:12 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-08-24 10:01:52 +0100 |
| commit | df28b0e939bd0f12ae31e6f7ba94fa954496b3b8 (patch) | |
| tree | 9dcdf8708fe678fc1419e90dc6fdc3f8da8fafb2 /src/wx | |
| parent | 2f1d460898f40844d47d6a3b858449ac09d8b342 (diff) | |
Allow import of OV/VF DCPs (#906).
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/audio_mapping_view.cc | 4 | ||||
| -rw-r--r-- | src/wx/content_menu.cc | 23 | ||||
| -rw-r--r-- | src/wx/content_menu.h | 2 | ||||
| -rw-r--r-- | src/wx/content_panel.cc | 9 |
4 files changed, 36 insertions, 2 deletions
diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc index f0ec44e6b..cb3cc786f 100644 --- a/src/wx/audio_mapping_view.cc +++ b/src/wx/audio_mapping_view.cc @@ -487,6 +487,10 @@ AudioMappingView::paint_top_labels () void AudioMappingView::set_input_groups (vector<Group> const & groups) { + if (_grid->GetNumberRows() == 0) { + return; + } + _input_groups = groups; _input_group_positions.clear (); diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 70fc766ac..3b1fd3189 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -53,6 +53,7 @@ enum { ID_properties, ID_re_examine, ID_kdm, + ID_ov, ID_remove }; @@ -65,7 +66,9 @@ ContentMenu::ContentMenu (wxWindow* p) _find_missing = _menu->Append (ID_find_missing, _("Find missing...")); _properties = _menu->Append (ID_properties, _("Properties...")); _re_examine = _menu->Append (ID_re_examine, _("Re-examine...")); + _menu->AppendSeparator (); _kdm = _menu->Append (ID_kdm, _("Add KDM...")); + _ov = _menu->Append (ID_ov, _("Add OV...")); _menu->AppendSeparator (); _remove = _menu->Append (ID_remove, _("Remove")); @@ -75,6 +78,7 @@ ContentMenu::ContentMenu (wxWindow* p) _parent->Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&ContentMenu::properties, this), ID_properties); _parent->Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&ContentMenu::re_examine, this), ID_re_examine); _parent->Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&ContentMenu::kdm, this), ID_kdm); + _parent->Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&ContentMenu::ov, this), ID_ov); _parent->Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&ContentMenu::remove, this), ID_remove); } @@ -338,6 +342,25 @@ ContentMenu::kdm () } void +ContentMenu::ov () +{ + DCPOMATIC_ASSERT (!_content.empty ()); + shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (_content.front ()); + DCPOMATIC_ASSERT (dcp); + + wxDirDialog* d = new wxDirDialog (_parent, _("Select OV")); + + if (d->ShowModal() == wxID_OK) { + dcp->add_ov (wx_to_std (d->GetPath ())); + shared_ptr<Film> film = _film.lock (); + DCPOMATIC_ASSERT (film); + film->examine_content (dcp); + } + + d->Destroy (); +} + +void ContentMenu::properties () { ContentPropertiesDialog* d = new ContentPropertiesDialog (_parent, _content.front ()); diff --git a/src/wx/content_menu.h b/src/wx/content_menu.h index b62f06662..9aaf9d59f 100644 --- a/src/wx/content_menu.h +++ b/src/wx/content_menu.h @@ -45,6 +45,7 @@ private: void properties (); void re_examine (); void kdm (); + void ov (); void remove (); void maybe_found_missing (boost::weak_ptr<Job>, boost::weak_ptr<Content>, boost::weak_ptr<Content>); @@ -60,6 +61,7 @@ private: wxMenuItem* _properties; wxMenuItem* _re_examine; wxMenuItem* _kdm; + wxMenuItem* _ov; wxMenuItem* _remove; boost::signals2::scoped_connection _job_connection; diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 73866fa59..1d9f010bf 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -498,7 +498,8 @@ ContentPanel::setup () 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 (); + bool const needs_kdm = dcp && dcp->needs_kdm (); + bool const needs_assets = dcp && dcp->needs_assets (); string s = i->summary (); @@ -510,6 +511,10 @@ ContentPanel::setup () s = _("NEEDS KDM: ") + s; } + if (needs_assets) { + s = _("NEEDS OV: ") + s; + } + wxListItem item; item.SetId (t); item.SetText (std_to_wx (s)); @@ -520,7 +525,7 @@ ContentPanel::setup () _content->SetItemState (t, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } - if (!valid || needs_kdm) { + if (!valid || needs_kdm || needs_assets) { _content->SetItemTextColour (t, *wxRED); } } |
