X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Faudio_plot.cc;h=7ed792351bb30e49ecbfa33fdb1ad12b72a3e286;hb=1ba7bca7f2950faa441ec83920d35b65016f3fa6;hp=b2be40036be74d9d5e591b286d30f95b65cc69ad;hpb=98ff4e6e7789d7a5226eacb5bc16dbaa073510ad;p=dcpomatic.git diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index b2be40036..7ed792351 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); @@ -60,7 +61,7 @@ AudioPlot::AudioPlot (wxWindow* parent) _colours.push_back (wxColour ( 0, 0, 255)); _colours.push_back (wxColour (100, 100, 100)); - Connect (wxID_ANY, wxEVT_PAINT, wxPaintEventHandler (AudioPlot::paint), 0, this); + Bind (wxEVT_PAINT, boost::bind (&AudioPlot::paint, this)); SetMinSize (wxSize (640, 512)); } @@ -96,7 +97,14 @@ AudioPlot::set_type_visible (int t, bool v) } void -AudioPlot::paint (wxPaintEvent &) +AudioPlot::set_message (wxString s) +{ + _message = s; + Refresh (); +} + +void +AudioPlot::paint () { 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; }