- if (_type_visible[AudioPoint::PEAK]) {
- gc->SetPen (*wxThePenList->FindOrCreatePen (wxColour (col.Red(), col.Green(), col.Blue(), col.Alpha() / 2)));
- gc->StrokePath (path[AudioPoint::PEAK]);
+ path.AddLineToPoint (metrics.db_label_width + i * metrics.x_scale, y_for_linear (peak, metrics));
+ }
+}
+
+void
+AudioPlot::plot_rms (wxGraphicsPath& path, int channel, Metrics const & metrics) const
+{
+ if (_analysis->points (channel) == 0) {
+ return;
+ }
+
+ path.MoveToPoint (metrics.db_label_width, y_for_linear (get_point(channel, 0)[AudioPoint::RMS], metrics));
+
+ list<float> smoothing;
+
+ int const N = _analysis->points(channel);
+
+ float const first = get_point(channel, 0)[AudioPoint::RMS];
+ float const last = get_point(channel, N - 1)[AudioPoint::RMS];
+
+ int const before = _smoothing / 2;
+ int const after = _smoothing - before;
+
+ /* Pre-load the smoothing list */
+ for (int i = 0; i < before; ++i) {
+ smoothing.push_back (first);
+ }
+ for (int i = 0; i < after; ++i) {
+ if (i < N) {
+ smoothing.push_back (get_point(channel, i)[AudioPoint::RMS]);
+ } else {
+ smoothing.push_back (last);