Emit no audio from DCPs if none is mapped
[dcpomatic.git] / src / wx / video_waveform_plot.cc
index f45a5662e9fee87c072952e8864fcad362c5b382..f6fa939403e2f00257ece606886635c85ce7e8d7 100644 (file)
 #include "lib/film.h"
 #include "lib/image.h"
 #include "lib/player_video.h"
-#include "lib/warnings.h"
 #include <dcp/locale_convert.h>
 #include <dcp/openjpeg_image.h>
-DCPOMATIC_DISABLE_WARNINGS
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <wx/graphics.h>
 #include <wx/rawbmp.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 #include <boost/bind/bind.hpp>
-#include <iostream>
 
 
-using std::cout;
 using std::make_shared;
 using std::max;
 using std::min;
@@ -55,7 +53,7 @@ int const VideoWaveformPlot::_pixel_values = 4096;
 int const VideoWaveformPlot::_x_axis_width = 52;
 
 
-VideoWaveformPlot::VideoWaveformPlot (wxWindow* parent, weak_ptr<const Film> film, weak_ptr<FilmViewer> viewer)
+VideoWaveformPlot::VideoWaveformPlot(wxWindow* parent, weak_ptr<const Film> film, FilmViewer& viewer)
        : wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)
        , _film (film)
 {
@@ -63,10 +61,7 @@ VideoWaveformPlot::VideoWaveformPlot (wxWindow* parent, weak_ptr<const Film> fil
        SetDoubleBuffered (true);
 #endif
 
-       auto fv = viewer.lock ();
-       DCPOMATIC_ASSERT (fv);
-
-       _viewer_connection = fv->ImageChanged.connect (boost::bind(&VideoWaveformPlot::set_image, this, _1));
+       _viewer_connection = viewer.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));
@@ -200,7 +195,7 @@ VideoWaveformPlot::set_image (shared_ptr<PlayerVideo> image)
        /* We must copy the PlayerVideo here as we will call ::image() on it, potentially
           with a different pixel_format than was used when ::prepare() was called.
        */
-       _image = DCPVideo::convert_to_xyz (image->shallow_copy(), [](dcp::NoteType, string) {});
+       _image = DCPVideo::convert_to_xyz(image->shallow_copy());
        _dirty = true;
        Refresh ();
 }