Tidy up creation of analysis a bit.
[dcpomatic.git] / src / wx / audio_plot.cc
index 1ad07fcce0dc9eb352c69d3456e28e0fac35cb2a..41d074dad485539b210ef34278fde82595a6b117 100644 (file)
@@ -65,15 +65,17 @@ AudioPlot::paint (wxPaintEvent &)
 {
        wxPaintDC dc (this);
 
-       if (!_analysis) {
-               return;
-       }
-       
        wxGraphicsContext* gc = wxGraphicsContext::Create (dc);
        if (!gc) {
                return;
        }
 
+       if (!_analysis) {
+               gc->SetFont (gc->CreateFont (*wxNORMAL_FONT));
+               gc->DrawText (_("Please wait; audio is being analysed..."), 32, 32);
+               return;
+       }
+       
        int const width = GetSize().GetWidth();
        float const xs = width / float (_analysis->points (_channel));
        int const height = GetSize().GetHeight ();