X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fvideo_waveform_plot.cc;h=826e173597d31038ec92cdbd421b2123be430b45;hb=e8748f158249d7be906f6c6cf2411df45dd07a24;hp=2e45f3493b69e1e0af0f29f95dfb2c9dbe538c40;hpb=39fb8198febde1937019db1c300ec363aab5aa56;p=dcpomatic.git diff --git a/src/wx/video_waveform_plot.cc b/src/wx/video_waveform_plot.cc index 2e45f3493..826e17359 100644 --- a/src/wx/video_waveform_plot.cc +++ b/src/wx/video_waveform_plot.cc @@ -28,13 +28,14 @@ #include "lib/player_video.h" #include #include -#include +#include +LIBDCP_DISABLE_WARNINGS #include +#include +LIBDCP_ENABLE_WARNINGS #include -#include -using std::cout; using std::make_shared; using std::max; using std::min; @@ -52,7 +53,7 @@ int const VideoWaveformPlot::_pixel_values = 4096; int const VideoWaveformPlot::_x_axis_width = 52; -VideoWaveformPlot::VideoWaveformPlot (wxWindow* parent, weak_ptr film, weak_ptr viewer) +VideoWaveformPlot::VideoWaveformPlot(wxWindow* parent, weak_ptr film, FilmViewer& viewer) : wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE) , _film (film) { @@ -60,10 +61,7 @@ VideoWaveformPlot::VideoWaveformPlot (wxWindow* parent, weak_ptr 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)); @@ -155,7 +153,7 @@ VideoWaveformPlot::create_waveform () auto const image_size = _image->size(); int const waveform_height = GetSize().GetHeight() - _vertical_margin * 2; - _waveform = make_shared(AV_PIX_FMT_RGB24, dcp::Size (image_size.width, waveform_height), true); + _waveform = make_shared(AV_PIX_FMT_RGB24, dcp::Size (image_size.width, waveform_height), Image::Alignment::PADDED); for (int x = 0; x < image_size.width; ++x) { @@ -182,7 +180,7 @@ VideoWaveformPlot::create_waveform () _waveform = _waveform->scale ( dcp::Size (GetSize().GetWidth() - _x_axis_width, waveform_height), - dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, false, false + dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, Image::Alignment::COMPACT, false ); }