summaryrefslogtreecommitdiff
path: root/src/wx/timeline.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-10-12 01:03:28 +0200
committerCarl Hetherington <cth@carlh.net>2022-10-14 11:41:18 +0200
commit449f383f13e5755c523db11f9adef53b58391025 (patch)
tree7751c6ede10455de02aa85dcd00d17109c9d57a6 /src/wx/timeline.cc
parent5e640ac3e2f6d5fb079ff65659a1483ddac8672e (diff)
Cleanup: use simpler ownership for FilmViewer.
Diffstat (limited to 'src/wx/timeline.cc')
-rw-r--r--src/wx/timeline.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index f6ede297d..6886daa42 100644
--- a/src/wx/timeline.cc
+++ b/src/wx/timeline.cc
@@ -67,7 +67,7 @@ double const Timeline::_minimum_pixels_per_second = 640.0 / (60 * 60 * 3);
int const Timeline::_minimum_pixels_per_track = 16;
-Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film, weak_ptr<FilmViewer> viewer)
+Timeline::Timeline(wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film, FilmViewer& viewer)
: wxPanel (parent, wxID_ANY)
, _labels_canvas (new wxScrolledCanvas (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE))
, _main_canvas (new wxScrolledCanvas (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE))
@@ -219,12 +219,9 @@ Timeline::paint_main ()
/* Playhead */
- auto vp = _viewer.lock ();
- DCPOMATIC_ASSERT (vp);
-
gc->SetPen (*wxRED_PEN);
auto path = gc->CreatePath ();
- double const ph = vp->position().seconds() * pixels_per_second().get_value_or(0);
+ double const ph = _viewer.position().seconds() * pixels_per_second().get_value_or(0);
path.MoveToPoint (ph, 0);
path.AddLineToPoint (ph, pixels_per_track() * _tracks + 32);
gc->StrokePath (path);