: 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);
_colours.push_back (wxColour (255, 0, 139));
_colours.push_back (wxColour (139, 0, 255));
+ set_analysis (shared_ptr<AudioAnalysis> ());
+
#if MAX_DCP_AUDIO_CHANNELS != 12
#warning AudioPlot::AudioPlot is expecting the wrong MAX_DCP_AUDIO_CHANNELS
#endif
{
_analysis = a;
- for (int i = 0; i < MAX_DCP_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 ();
}
gc->DrawText (std_to_wx (String::compose ("%1dB", i)), 0, y - (db_label_height / 2));
}
- gc->SetPen (*wxLIGHT_GREY_PEN);
+ gc->SetPen (wxPen (wxColour (200, 200, 200)));
gc->StrokePath (grid);
gc->DrawText (_("Time"), data_width, metrics.height - metrics.y_origin + db_label_height / 2);
plot_peak (p, c, metrics);
}
wxColour const col = _colours[c];
- gc->SetPen (*wxThePenList->FindOrCreatePen (wxColour (col.Red(), col.Green(), col.Blue(), col.Alpha() / 2), 1, wxPENSTYLE_SOLID));
+ gc->SetPen (wxPen (wxColour (col.Red(), col.Green(), col.Blue(), col.Alpha() / 2), 1, wxPENSTYLE_SOLID));
gc->StrokePath (p);
}
}
plot_rms (p, c, metrics);
}
wxColour const col = _colours[c];
- gc->SetPen (*wxThePenList->FindOrCreatePen (col, 1, wxPENSTYLE_SOLID));
+ gc->SetPen (wxPen (col, 1, wxPENSTYLE_SOLID));
gc->StrokePath (p);
}
}
axes.MoveToPoint (metrics.db_label_width, 0);
axes.AddLineToPoint (metrics.db_label_width, metrics.height - metrics.y_origin);
axes.AddLineToPoint (metrics.db_label_width + data_width, metrics.height - metrics.y_origin);
- gc->SetPen (*wxBLACK_PEN);
+ gc->SetPen (wxPen (wxColour (0, 0, 0)));
gc->StrokePath (axes);
delete gc;
p += pow (*j, 2);
}
- if (smoothing.size() > 0) {
+ if (!smoothing.empty ()) {
p = sqrt (p / smoothing.size ());
}