Add audio gain to timeline content view.
authorCarl Hetherington <cth@carlh.net>
Wed, 4 Jul 2018 23:02:06 +0000 (00:02 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 4 Jul 2018 23:02:06 +0000 (00:02 +0100)
src/wx/timeline_audio_content_view.cc

index fe098c48b061220f1c0d57dfd7e5d45cbd26b5b9..330196a97317f17851f3ae5dd605e334ff1ddddb 100644 (file)
@@ -55,6 +55,13 @@ TimelineAudioContentView::label () const
        wxString s = TimelineContentView::label ();
        shared_ptr<AudioContent> ac = content()->audio;
        DCPOMATIC_ASSERT (ac);
+
+       if (ac->gain() > 0.01) {
+               s += wxString::Format (" +%.1fdB", ac->gain());
+       } else if (ac->gain() < -0.01) {
+               s += wxString::Format (" %.1fdB", ac->gain());
+       }
+
        list<int> mapped = ac->mapping().mapped_output_channels();
        if (!mapped.empty ()) {
                s += " → ";
@@ -63,5 +70,6 @@ TimelineAudioContentView::label () const
                }
                s = s.Left(s.Length() - 2);
        }
+
        return s;
 }