X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwx%2Faudio_mapping_view.cc;h=ac85407a2f4a5938fb9fd2538a022189f98d87ca;hb=308488324dbc4d8b709d3fb1dc9fee0479346c21;hp=52303ac14b2e9b94996bbf8950f42e3bf4458abc;hpb=854f2e5bbb7ffb9758b823af87034033033f3cb8;p=dcpomatic.git diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc index 52303ac14..ac85407a2 100644 --- a/src/wx/audio_mapping_view.cc +++ b/src/wx/audio_mapping_view.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +17,10 @@ */ +/** @file src/wx/audio_mapping_view.cc + * @brief AudioMappingView class and helpers. + */ + #include #include #include @@ -26,6 +30,7 @@ #include "audio_mapping_view.h" #include "wx_util.h" #include "audio_gain_dialog.h" +#include using std::cout; using std::list; @@ -52,14 +57,15 @@ public: } }; +/** @class ValueRenderer + * @brief wxGridCellRenderer for a gain value. + */ class ValueRenderer : public wxGridCellRenderer { public: void Draw (wxGrid& grid, wxGridCellAttr &, wxDC& dc, const wxRect& rect, int row, int col, bool) { - LocaleGuard lg; - dc.SetPen (*wxThePenList->FindOrCreatePen (wxColour (255, 255, 255), 1, wxPENSTYLE_SOLID)); dc.SetBrush (*wxTheBrushList->FindOrCreateBrush (wxColour (255, 255, 255), wxBRUSHSTYLE_SOLID)); dc.DrawRectangle (rect); @@ -111,7 +117,7 @@ AudioMappingView::AudioMappingView (wxWindow* parent) { _grid = new wxGrid (this, wxID_ANY); - _grid->CreateGrid (0, MAX_AUDIO_CHANNELS + 1); + _grid->CreateGrid (0, MAX_DCP_AUDIO_CHANNELS + 1); _grid->HideRowLabels (); _grid->DisableDragRowSize (); _grid->DisableDragColSize (); @@ -224,8 +230,6 @@ AudioMappingView::set (AudioMapping map) void AudioMappingView::update_cells () { - LocaleGuard lg; - if (_grid->GetNumberRows ()) { _grid->DeleteRows (0, _grid->GetNumberRows ()); } @@ -233,7 +237,7 @@ AudioMappingView::update_cells () _grid->InsertRows (0, _map.content_channels ()); for (int i = 0; i < _map.content_channels(); ++i) { - for (int j = 0; j < MAX_AUDIO_CHANNELS; ++j) { + for (int j = 0; j < MAX_DCP_AUDIO_CHANNELS; ++j) { _grid->SetCellRenderer (i, j + 1, new ValueRenderer); } } @@ -272,8 +276,8 @@ AudioMappingView::set_column_labels () _grid->SetColLabelValue (0, _("Content")); -#if MAX_AUDIO_CHANNELS != 12 -#warning AudioMappingView::set_column_labels() is expecting the wrong MAX_AUDIO_CHANNELS +#if MAX_DCP_AUDIO_CHANNELS != 12 +#warning AudioMappingView::set_column_labels() is expecting the wrong MAX_DCP_AUDIO_CHANNELS #endif if (c > 0) {