+void
+AudioMappingView::set_column_labels ()
+{
+ int const c = _grid->GetNumberCols ();
+
+ _grid->SetColLabelValue (0, _("Content"));
+
+#if MAX_DCP_AUDIO_CHANNELS != 12
+#warning AudioMappingView::set_column_labels() is expecting the wrong MAX_DCP_AUDIO_CHANNELS
+#endif
+
+ if (c > 0) {
+ _grid->SetColLabelValue (1, _("L"));
+ }
+
+ if (c > 1) {
+ _grid->SetColLabelValue (2, _("R"));
+ }
+
+ if (c > 2) {
+ _grid->SetColLabelValue (3, _("C"));
+ }
+
+ if (c > 3) {
+ _grid->SetColLabelValue (4, _("Lfe"));
+ }
+
+ if (c > 4) {
+ _grid->SetColLabelValue (5, _("Ls"));
+ }
+
+ if (c > 5) {
+ _grid->SetColLabelValue (6, _("Rs"));
+ }
+
+ if (c > 6) {
+ _grid->SetColLabelValue (7, _("HI"));
+ }
+
+ if (c > 7) {
+ _grid->SetColLabelValue (8, _("VI"));
+ }
+
+ if (c > 8) {
+ _grid->SetColLabelValue (9, _("Lc"));
+ }
+
+ if (c > 9) {
+ _grid->SetColLabelValue (10, _("Rc"));
+ }
+
+ if (c > 10) {
+ _grid->SetColLabelValue (11, _("BsL"));
+ }
+
+ if (c > 11) {
+ _grid->SetColLabelValue (12, _("BsR"));
+ }
+
+ _grid->AutoSize ();
+}
+
+void
+AudioMappingView::mouse_moved (wxMouseEvent& ev)
+{
+ int xx;
+ int yy;
+ _grid->CalcUnscrolledPosition (ev.GetX(), ev.GetY(), &xx, &yy);
+
+ int const row = _grid->YToRow (yy);
+ int const column = _grid->XToCol (xx);
+
+ if (row < 0 || column < 1) {
+ _grid->GetGridWindow()->SetToolTip ("");
+ _last_tooltip_row = row;
+ _last_tooltip_column = column;
+ }
+
+ if (row != _last_tooltip_row || column != _last_tooltip_column) {
+
+ wxString s;
+ float const gain = _map.get (row, static_cast<dcp::Channel> (column - 1));
+ if (gain == 0) {
+ s = wxString::Format (_("No audio will be passed from content channel %d to DCP channel %d."), row + 1, column);
+ } else if (gain == 1) {
+ s = wxString::Format (_("Audio will be passed from content channel %d to DCP channel %d unaltered."), row + 1, column);
+ } else {
+ float const dB = 20 * log10 (gain);
+ s = wxString::Format (_("Audio will be passed from content channel %d to DCP channel %d with gain %.1fdB."), row + 1, column, dB);
+ }
+
+ _grid->GetGridWindow()->SetToolTip (s + " " + _("Right click to change gain."));
+ _last_tooltip_row = row;
+ _last_tooltip_column = column;
+ }
+
+ ev.Skip ();
+}