_colours.push_back (wxColour ( 0, 0, 255));
_colours.push_back (wxColour (100, 100, 100));
- Connect (wxID_ANY, wxEVT_PAINT, wxPaintEventHandler (AudioPlot::paint), 0, this);
+ Bind (wxEVT_PAINT, boost::bind (&AudioPlot::paint, this));
SetMinSize (wxSize (640, 512));
}
}
void
-AudioPlot::paint (wxPaintEvent &)
+AudioPlot::paint ()
{
wxPaintDC dc (this);
gc->SetPen (*wxLIGHT_GREY_PEN);
gc->StrokePath (grid);
- gc->DrawText (_("Time"), data_width, _height - _y_origin + db_label_height / 2);
-
+ gc->DrawText (_("DCPTime"), data_width, _height - _y_origin + db_label_height / 2);
if (_type_visible[AudioPoint::PEAK]) {
for (int c = 0; c < MAX_AUDIO_CHANNELS; ++c) {
p += pow (*j, 2);
}
- p = sqrt (p / smoothing.size ());
+ if (smoothing.size() > 0) {
+ p = sqrt (p / smoothing.size ());
+ }
path.AddLineToPoint (_db_label_width + i * _x_scale, y_for_linear (p));
}