summaryrefslogtreecommitdiff
path: root/src/wx/audio_plot.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-25 11:38:15 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-25 11:38:15 +0100
commit45a523803b72cf132b44b6feec543e3587becf3a (patch)
tree336aea4db3519643299b3552e524f4c1b74814b2 /src/wx/audio_plot.cc
parent8b05d71534e5e27ef4514af781a9e9d1259e7c03 (diff)
Prevent infinite loop of audio analysis if it is cancelled.
Diffstat (limited to 'src/wx/audio_plot.cc')
-rw-r--r--src/wx/audio_plot.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc
index b2be40036..2539a93d9 100644
--- a/src/wx/audio_plot.cc
+++ b/src/wx/audio_plot.cc
@@ -40,6 +40,7 @@ AudioPlot::AudioPlot (wxWindow* parent)
: wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)
, _gain (0)
, _smoothing (max_smoothing / 2)
+ , _message (_("Please wait; audio is being analysed..."))
{
#ifndef __WXOSX__
SetDoubleBuffered (true);
@@ -96,6 +97,13 @@ AudioPlot::set_type_visible (int t, bool v)
}
void
+AudioPlot::set_message (wxString s)
+{
+ _message = s;
+ Refresh ();
+}
+
+void
AudioPlot::paint (wxPaintEvent &)
{
wxPaintDC dc (this);
@@ -107,7 +115,7 @@ AudioPlot::paint (wxPaintEvent &)
if (!_analysis || _analysis->channels() == 0) {
gc->SetFont (gc->CreateFont (*wxNORMAL_FONT));
- gc->DrawText (_("Please wait; audio is being analysed..."), 32, 32);
+ gc->DrawText (_message, 32, 32);
return;
}