X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Faudio_plot.cc;h=c4e5d992fe2c11a3dbc107b287a1462e8437ca54;hb=4616b19fb5241a54c9d57f7a91bb975f41aed14b;hp=2e8b24e367ebe15b70fc927489a4a3b0718ddfaa;hpb=298395454530a7bbcd2ea333d57dff8be8468bba;p=dcpomatic.git diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index 2e8b24e36..c4e5d992f 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -40,13 +40,12 @@ AudioPlot::AudioPlot (wxWindow* parent) : wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE) , _gain (0) , _smoothing (max_smoothing / 2) - , _message (_("Please wait; audio is being analysed...")) { #ifndef __WXOSX__ SetDoubleBuffered (true); #endif - for (int i = 0; i < MAX_AUDIO_CHANNELS; ++i) { + for (int i = 0; i < MAX_DCP_AUDIO_CHANNELS; ++i) { _channel_visible[i] = false; } @@ -62,9 +61,15 @@ AudioPlot::AudioPlot (wxWindow* parent) _colours.push_back (wxColour ( 0, 139, 0)); _colours.push_back (wxColour ( 0, 0, 139)); _colours.push_back (wxColour (255, 255, 0)); + _colours.push_back (wxColour ( 0, 255, 255)); + _colours.push_back (wxColour (255, 0, 255)); + _colours.push_back (wxColour (255, 0, 139)); + _colours.push_back (wxColour (139, 0, 255)); -#if MAX_AUDIO_CHANNELS != 8 -#warning AudioPlot::AudioPlot is expecting the wrong MAX_AUDIO_CHANNELS + set_analysis (shared_ptr ()); + +#if MAX_DCP_AUDIO_CHANNELS != 12 +#warning AudioPlot::AudioPlot is expecting the wrong MAX_DCP_AUDIO_CHANNELS #endif Bind (wxEVT_PAINT, boost::bind (&AudioPlot::paint, this)); @@ -77,14 +82,10 @@ AudioPlot::set_analysis (shared_ptr a) { _analysis = a; - for (int i = 0; i < MAX_AUDIO_CHANNELS; ++i) { - _channel_visible[i] = false; + if (!a) { + _message = _("Please wait; audio is being analysed..."); } - for (int i = 0; i < AudioPoint::COUNT; ++i) { - _type_visible[i] = false; - } - Refresh (); } @@ -164,7 +165,7 @@ AudioPlot::paint () gc->DrawText (_("Time"), data_width, metrics.height - metrics.y_origin + db_label_height / 2); if (_type_visible[AudioPoint::PEAK]) { - for (int c = 0; c < MAX_AUDIO_CHANNELS; ++c) { + for (int c = 0; c < MAX_DCP_AUDIO_CHANNELS; ++c) { wxGraphicsPath p = gc->CreatePath (); if (_channel_visible[c] && c < _analysis->channels()) { plot_peak (p, c, metrics); @@ -176,7 +177,7 @@ AudioPlot::paint () } if (_type_visible[AudioPoint::RMS]) { - for (int c = 0; c < MAX_AUDIO_CHANNELS; ++c) { + for (int c = 0; c < MAX_DCP_AUDIO_CHANNELS; ++c) { wxGraphicsPath p = gc->CreatePath (); if (_channel_visible[c] && c < _analysis->channels()) { plot_rms (p, c, metrics);