summaryrefslogtreecommitdiff
path: root/src/wx/timeline_video_content_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-06-01 00:27:57 +0100
committerCarl Hetherington <cth@carlh.net>2019-06-01 00:27:57 +0100
commitb68fb4c103b5580509070c7733d3ae7deb46c3ce (patch)
tree32f0c602e1ff5666d6c7dde77ab0d8bcb56b87ab /src/wx/timeline_video_content_view.cc
parentdfb23250338ceccbe0fc4e405db6e4df4875a225 (diff)
Basics of allowing video parts of FFmpegContent to be disabled (#1355 and others).
Diffstat (limited to 'src/wx/timeline_video_content_view.cc')
-rw-r--r--src/wx/timeline_video_content_view.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/wx/timeline_video_content_view.cc b/src/wx/timeline_video_content_view.cc
index 731108c93..db1520190 100644
--- a/src/wx/timeline_video_content_view.cc
+++ b/src/wx/timeline_video_content_view.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2019 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -18,8 +18,9 @@
*/
-#include "timeline_video_content_view.h"
#include "lib/image_content.h"
+#include "lib/video_content.h"
+#include "timeline_video_content_view.h"
using boost::dynamic_pointer_cast;
using boost::shared_ptr;
@@ -33,12 +34,27 @@ TimelineVideoContentView::TimelineVideoContentView (Timeline& tl, shared_ptr<Con
wxColour
TimelineVideoContentView::background_colour () const
{
+ if (!active()) {
+ return wxColour (210, 210, 210, 128);
+ }
+
return wxColour (242, 92, 120, 255);
}
wxColour
TimelineVideoContentView::foreground_colour () const
{
+ if (!active()) {
+ return wxColour (180, 180, 180, 128);
+ }
+
return wxColour (0, 0, 0, 255);
}
+bool
+TimelineVideoContentView::active () const
+{
+ shared_ptr<Content> c = _content.lock ();
+ DCPOMATIC_ASSERT (c);
+ return c->video && c->video->use();
+}