diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-02-25 00:28:03 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-02-25 00:28:03 +0000 |
| commit | 5702637ee38f0349fd0b7f17f10bda581e795a9d (patch) | |
| tree | 48ce4ccfd3f61590adb86a8ff542d999018c6c7f /src/wx/audio_plot.cc | |
| parent | 32ae1f11a9d3e1530c3939190690b5a524997ccb (diff) | |
Respond to gain in the audio dialog.
Diffstat (limited to 'src/wx/audio_plot.cc')
| -rw-r--r-- | src/wx/audio_plot.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index cc2d8f6b4..d438426c7 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -36,6 +36,7 @@ using boost::shared_ptr; AudioPlot::AudioPlot (wxWindow* parent) : wxPanel (parent) , _channel (0) + , _gain (0) { Connect (wxID_ANY, wxEVT_PAINT, wxPaintEventHandler (AudioPlot::paint), 0, this); @@ -91,12 +92,12 @@ AudioPlot::paint (wxPaintEvent &) for (int i = 0; i < AudioPoint::COUNT; ++i) { path[i] = gc->CreatePath (); - path[i].MoveToPoint (0, height - (max (_analysis->get_point(_channel, 0)[i], -60.0f) + 60) * ys); + path[i].MoveToPoint (0, height - (max (_analysis->get_point(_channel, 0)[i], -60.0f) + 60 + _gain) * ys); } for (int i = 0; i < _analysis->points(_channel); ++i) { for (int j = 0; j < AudioPoint::COUNT; ++j) { - path[j].AddLineToPoint (i * xs, height - (max (_analysis->get_point(_channel, i)[j], -60.0f) + 60) * ys); + path[j].AddLineToPoint (i * xs, height - (max (_analysis->get_point(_channel, i)[j], -60.0f) + 60 + _gain) * ys); } } @@ -108,3 +109,10 @@ AudioPlot::paint (wxPaintEvent &) delete gc; } + +void +AudioPlot::set_gain (float g) +{ + _gain = g; + Refresh (); +} |
