#include "lib/dcp_video.h"
#include <dcp/locale_convert.h>
#include <dcp/openjpeg_image.h>
#include "lib/dcp_video.h"
#include <dcp/locale_convert.h>
#include <dcp/openjpeg_image.h>
-VideoWaveformPlot::VideoWaveformPlot (wxWindow* parent, weak_ptr<const Film> film, FilmViewer* viewer)
+VideoWaveformPlot::VideoWaveformPlot (wxWindow* parent, weak_ptr<const Film> film, weak_ptr<FilmViewer> viewer)
: wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)
, _film (film)
, _dirty (true)
: wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)
, _film (film)
, _dirty (true)
- _viewer_connection = viewer->ImageChanged.connect (boost::bind (&VideoWaveformPlot::set_image, this, _1));
+ shared_ptr<FilmViewer> fv = viewer.lock ();
+ DCPOMATIC_ASSERT (fv);
+
+ _viewer_connection = fv->ImageChanged.connect (boost::bind (&VideoWaveformPlot::set_image, this, _1));
Bind (wxEVT_PAINT, boost::bind (&VideoWaveformPlot::paint, this));
Bind (wxEVT_SIZE, boost::bind (&VideoWaveformPlot::sized, this, _1));
Bind (wxEVT_PAINT, boost::bind (&VideoWaveformPlot::paint, this));
Bind (wxEVT_SIZE, boost::bind (&VideoWaveformPlot::sized, this, _1));