X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Ftimeline_content_view.cc;h=5d039d0d3f0a2e82d252da234f63519b8eb4864e;hp=bb84d6147fe50e1b22f4a74145e3eac80c73257a;hb=4d8f96e15edb4807cc9773cc7f9eb6aa56ac2dc8;hpb=8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8 diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc index bb84d6147..5d039d0d3 100644 --- a/src/wx/timeline_content_view.cc +++ b/src/wx/timeline_content_view.cc @@ -18,11 +18,16 @@ */ -#include "timeline_content_view.h" + #include "timeline.h" +#include "timeline_content_view.h" #include "wx_util.h" #include "lib/content.h" +#include +LIBDCP_DISABLE_WARNINGS #include +LIBDCP_ENABLE_WARNINGS + using std::list; using std::shared_ptr; @@ -31,14 +36,15 @@ using namespace dcpomatic; using namespace boost::placeholders; #endif + TimelineContentView::TimelineContentView (Timeline& tl, shared_ptr c) : TimelineView (tl) , _content (c) - , _selected (false) { _content_connection = c->Change.connect (bind (&TimelineContentView::content_change, this, _1, _3)); } + dcpomatic::Rect TimelineContentView::bbox () const { @@ -58,6 +64,7 @@ TimelineContentView::bbox () const ); } + void TimelineContentView::set_selected (bool s) { @@ -65,38 +72,44 @@ TimelineContentView::set_selected (bool s) force_redraw (); } + bool TimelineContentView::selected () const { return _selected; } + shared_ptr TimelineContentView::content () const { return _content.lock (); } + void TimelineContentView::set_track (int t) { _track = t; } + void TimelineContentView::unset_track () { _track = boost::optional(); } + boost::optional TimelineContentView::track () const { return _track; } + void -TimelineContentView::do_paint (wxGraphicsContext* gc, list > overlaps) +TimelineContentView::do_paint (wxGraphicsContext* gc, list> overlaps) { DCPOMATIC_ASSERT (_track); @@ -106,8 +119,8 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list return; } - DCPTime const position = cont->position (); - DCPTime const len = cont->length_after_trim (film); + auto const position = cont->position (); + auto const len = cont->length_after_trim (film); wxColour selected (background_colour().Red() / 2, background_colour().Green() / 2, background_colour().Blue() / 2); @@ -157,11 +170,6 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list gc->PopState (); } -int -TimelineContentView::y_pos (int t) const -{ - return t * _timeline.pixels_per_track() + _timeline.tracks_y_offset(); -} void TimelineContentView::content_change (ChangeType type, int p) @@ -177,6 +185,7 @@ TimelineContentView::content_change (ChangeType type, int p) } } + wxString TimelineContentView::label () const {