CCAP doc tweaks.
[dcpomatic.git] / src / wx / audio_dialog.cc
index 938ecd1d3396223a8d3066d4b470821c5e448bfb..8c015ab68fabf5d95496f1b98ce2ba9cbc48b6e9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -74,6 +74,8 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Co
 
        wxBoxSizer* left = new wxBoxSizer (wxVERTICAL);
 
+       _cursor = new wxStaticText (this, wxID_ANY, wxT("Cursor: none"));
+       left->Add (_cursor, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP);
        _plot = new AudioPlot (this);
        left->Add (_plot, 1, wxTOP | wxEXPAND, 12);
        _sample_peak = new wxStaticText (this, wxID_ANY, wxT (""));
@@ -149,7 +151,8 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Co
        overall_sizer->SetSizeHints (this);
 
        _film_connection = film->ContentChanged.connect (boost::bind (&AudioDialog::content_changed, this, _2));
-       SetTitle (_("DCP-o-matic audio"));
+       DCPOMATIC_ASSERT (film->directory());
+       SetTitle(wxString::Format(_("DCP-o-matic audio - %s"), std_to_wx(film->directory().get().string())));
 
        if (content) {
                _playlist.reset (new Playlist ());
@@ -157,6 +160,8 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Co
        } else {
                _playlist = film->playlist ();
        }
+
+       _plot->Cursor.connect (bind (&AudioDialog::set_cursor, this, _1, _2));
 }
 
 void
@@ -383,3 +388,16 @@ AudioDialog::Show (bool show)
        try_to_load_analysis ();
        return r;
 }
+
+void
+AudioDialog::set_cursor (optional<DCPTime> time, optional<float> db)
+{
+       if (!time || !db) {
+               _cursor->SetLabel (_("Cursor: none"));
+               return;
+       }
+
+       shared_ptr<Film> film = _film.lock();
+       DCPOMATIC_ASSERT (film);
+       _cursor->SetLabel (wxString::Format (_("Cursor: %.1fdB at %s"), *db, time->timecode(film->video_frame_rate())));
+}