Add tooltips over content channel names in the audio mapping view (#888).
[dcpomatic.git] / src / wx / audio_dialog.cc
index 20185bf8f6dca8c33552818fe2b4b25e2c15140c..b2fb0efe5d4aa2b2341d686ca8b3fdce170626fe 100644 (file)
@@ -1,19 +1,20 @@
 /*
     Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
 
-    This program is free software; you can redistribute it and/or modify
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
-    This program is distributed in the hope that it will be useful,
+    DCP-o-matic is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
@@ -39,8 +40,15 @@ using boost::const_pointer_cast;
 using boost::dynamic_pointer_cast;
 
 /** @param content Content to analyse, or 0 to analyse all of the film's audio */
-AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<AudioContent> content)
-       : wxDialog (parent, wxID_ANY, _("Audio"), wxDefaultPosition, wxSize (640, 512), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE)
+AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Content> content)
+       : wxDialog (
+               parent,
+               wxID_ANY,
+               _("Audio"),
+               wxDefaultPosition,
+               wxSize (640, 512),
+               wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE | wxSTAY_ON_TOP
+               )
        , _film (film)
        , _content (content)
        , _channels (film->audio_channels ())
@@ -175,10 +183,10 @@ AudioDialog::try_to_load_analysis ()
                /* Nothing checked; check mapped ones */
 
                list<int> mapped;
-               shared_ptr<AudioContent> content = _content.lock ();
+               shared_ptr<Content> content = _content.lock ();
 
                if (content) {
-                       mapped = content->audio_mapping().mapped_output_channels ();
+                       mapped = content->audio->mapping().mapped_output_channels ();
                } else {
                        mapped = film->mapped_audio_channels ();
                }
@@ -239,9 +247,9 @@ AudioDialog::channel_clicked (wxCommandEvent& ev)
 void
 AudioDialog::content_changed (int p)
 {
-       if (p == AudioContentProperty::AUDIO_STREAMS) {
+       if (p == AudioContentProperty::STREAMS) {
                try_to_load_analysis ();
-       } else if (p == AudioContentProperty::AUDIO_GAIN) {
+       } else if (p == AudioContentProperty::GAIN) {
                if (_playlist->content().size() == 1 && _analysis) {
                        /* We can use a short-cut to render the effect of this
                           change, rather than recalculating everything.