#include <boost/bind.hpp>
#include <wx/graphics.h>
#include "audio_plot.h"
-#include "lib/decoder_factory.h"
#include "lib/audio_decoder.h"
#include "lib/audio_analysis.h"
#include "wx/wx_util.h"
int const AudioPlot::max_smoothing = 128;
AudioPlot::AudioPlot (wxWindow* parent)
- : wxPanel (parent)
+ : wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)
, _gain (0)
, _smoothing (max_smoothing / 2)
{
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;
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;