TimelineContentView::TimelineContentView (Timeline& tl, shared_ptr<Content> c)
: TimelineView (tl)
, _content (c)
- , _selected (false)
{
_content_connection = c->Change.connect (bind (&TimelineContentView::content_change, this, _1, _3));
}
{
DCPOMATIC_ASSERT (_track);
- shared_ptr<const Film> film = _timeline.film ();
- shared_ptr<const Content> content = _content.lock ();
+ auto film = _timeline.film ();
+ auto content = _content.lock ();
if (!film || !content) {
- return dcpomatic::Rect<int> ();
+ return {};
}
return dcpomatic::Rect<int> (
void
TimelineContentView::unset_track ()
{
- _track = boost::optional<int> ();
+ _track = boost::optional<int>();
}
boost::optional<int>
{
DCPOMATIC_ASSERT (_track);
- shared_ptr<const Film> film = _timeline.film ();
- shared_ptr<const Content> cont = content ();
+ auto film = _timeline.film ();
+ auto cont = content ();
if (!film || !cont) {
return;
}
}
/* 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);
/* Overlaps */
gc->SetBrush (*wxTheBrushList->FindOrCreateBrush (foreground_colour(), wxBRUSHSTYLE_CROSSDIAG_HATCH));
- for (list<dcpomatic::Rect<int> >::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;
void
TimelineContentView::content_change (ChangeType type, int p)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}