summaryrefslogtreecommitdiff
path: root/src/wx/audio_plot.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/wx/audio_plot.cc')
-rw-r--r--src/wx/audio_plot.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc
index fb02fea7b..e2e2cdf76 100644
--- a/src/wx/audio_plot.cc
+++ b/src/wx/audio_plot.cc
@@ -1,5 +1,3 @@
-/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
-
/*
Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
@@ -193,6 +191,10 @@ AudioPlot::y_for_linear (float p) const
void
AudioPlot::plot_peak (wxGraphicsPath& path, int channel) const
{
+ if (_analysis->points (channel) == 0) {
+ return;
+ }
+
path.MoveToPoint (_db_label_width, y_for_linear (_analysis->get_point(channel, 0)[AudioPoint::PEAK]));
float peak = 0;
@@ -213,6 +215,10 @@ AudioPlot::plot_peak (wxGraphicsPath& path, int channel) const
void
AudioPlot::plot_rms (wxGraphicsPath& path, int channel) const
{
+ if (_analysis->points (channel) == 0) {
+ return;
+ }
+
path.MoveToPoint (_db_label_width, y_for_linear (_analysis->get_point(channel, 0)[AudioPoint::RMS]));
list<float> smoothing;