summaryrefslogtreecommitdiff
path: root/src/wx/audio_panel.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-10-13 11:30:30 +0100
committerCarl Hetherington <cth@carlh.net>2015-10-13 11:30:30 +0100
commit6f23b55a7783f93549115a133ca2e6e938bd0cd1 (patch)
tree6c674d088eb37dd9d91992366cfa6ddb3e0e69e5 /src/wx/audio_panel.cc
parentf9068dcbfbb09082e29e2a779ef1a7a2f6ee849e (diff)
Some attempts to block referencing of DCPs when it is not possible.
Diffstat (limited to 'src/wx/audio_panel.cc')
-rw-r--r--src/wx/audio_panel.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc
index a4976b8c1..9632b5235 100644
--- a/src/wx/audio_panel.cc
+++ b/src/wx/audio_panel.cc
@@ -141,6 +141,8 @@ AudioPanel::film_changed (Film::Property property)
case Film::VIDEO_FRAME_RATE:
setup_description ();
break;
+ case Film::REEL_TYPE:
+ setup_sensitivity ();
default:
break;
}
@@ -238,7 +240,24 @@ void
AudioPanel::setup_sensitivity ()
{
AudioContentList sel = _parent->selected_audio ();
- _reference->Enable (sel.size() == 1 && dynamic_pointer_cast<DCPContent> (sel.front ()));
+
+ shared_ptr<DCPContent> dcp;
+ if (sel.size() == 1) {
+ dcp = dynamic_pointer_cast<DCPContent> (sel.front ());
+ }
+
+ list<string> why_not;
+ bool const can_reference = dcp && dcp->can_reference_audio (why_not);
+ _reference->Enable (can_reference);
+
+ wxString s;
+ if (!can_reference) {
+ s = _("Cannot reference this DCP. ");
+ BOOST_FOREACH (string i, why_not) {
+ s += std_to_wx(i) + wxT(" ");
+ }
+ }
+ _reference->SetToolTip (s);
if (_reference->GetValue ()) {
_gain->wrapped()->Enable (false);