X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline_content_view.cc;h=481e8100d2b77037c6e854b181a1ccaef0069a7b;hb=f1b5aacedf659fdc5a5ab42c0238844ba74ba56a;hp=2af1c28ac3ce69086407df9daa431dad6aa8ed2f;hpb=c04fec82d25127fafa73c3daff87bece9aa8c8e8;p=dcpomatic.git diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc index 2af1c28ac..481e8100d 100644 --- a/src/wx/timeline_content_view.cc +++ b/src/wx/timeline_content_view.cc @@ -23,10 +23,9 @@ #include "wx_util.h" #include "lib/content.h" #include -#include using std::list; -using boost::shared_ptr; +using std::shared_ptr; using namespace dcpomatic; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; @@ -35,7 +34,6 @@ using namespace boost::placeholders; 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)); } @@ -45,10 +43,10 @@ TimelineContentView::bbox () const { DCPOMATIC_ASSERT (_track); - shared_ptr film = _timeline.film (); - shared_ptr content = _content.lock (); + auto film = _timeline.film (); + auto content = _content.lock (); if (!film || !content) { - return dcpomatic::Rect (); + return {}; } return dcpomatic::Rect ( @@ -87,7 +85,7 @@ TimelineContentView::set_track (int t) void TimelineContentView::unset_track () { - _track = boost::optional (); + _track = boost::optional(); } boost::optional @@ -97,18 +95,18 @@ TimelineContentView::track () const } void -TimelineContentView::do_paint (wxGraphicsContext* gc, list > overlaps) +TimelineContentView::do_paint (wxGraphicsContext* gc, list> overlaps) { DCPOMATIC_ASSERT (_track); - shared_ptr film = _timeline.film (); - shared_ptr cont = content (); + auto film = _timeline.film (); + auto cont = content (); if (!film || !cont) { 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); @@ -120,7 +118,7 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list } /* Outline */ - wxGraphicsPath path = gc->CreatePath (); + auto path = gc->CreatePath (); path.MoveToPoint (time_x (position) + 2, y_pos (_track.get()) + 4); path.AddLineToPoint (time_x (position + len) - 1, y_pos (_track.get()) + 4); path.AddLineToPoint (time_x (position + len) - 1, y_pos (_track.get() + 1) - 4); @@ -131,7 +129,7 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list /* Reel split points */ gc->SetPen (*wxThePenList->FindOrCreatePen (foreground_colour(), 1, wxPENSTYLE_DOT)); - BOOST_FOREACH (DCPTime i, cont->reel_split_points(film)) { + for (auto i: cont->reel_split_points(film)) { path = gc->CreatePath (); path.MoveToPoint (time_x (i), y_pos (_track.get()) + 4); path.AddLineToPoint (time_x (i), y_pos (_track.get() + 1) - 4); @@ -140,12 +138,12 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list /* Overlaps */ gc->SetBrush (*wxTheBrushList->FindOrCreateBrush (foreground_colour(), wxBRUSHSTYLE_CROSSDIAG_HATCH)); - for (list >::const_iterator i = overlaps.begin(); i != overlaps.end(); ++i) { - gc->DrawRectangle (i->x, i->y + 4, i->width, i->height - 8); + for (auto const& i: overlaps) { + gc->DrawRectangle (i.x, i.y + 4, i.width, i.height - 8); } /* Label text */ - wxString lab = label (); + auto lab = label (); wxDouble lab_width; wxDouble lab_height; wxDouble lab_descent; @@ -167,7 +165,7 @@ TimelineContentView::y_pos (int t) const void TimelineContentView::content_change (ChangeType type, int p) { - if (type != CHANGE_TYPE_DONE) { + if (type != ChangeType::DONE) { return; }