Remove all the curl multi stuff as I'm not sure what advantages it has for us over...
[dcpomatic.git] / src / wx / audio_mapping_view.cc
index 809b16bc862ee90af12d08e1b67041a0fb5df6bd..407abb503b801173565571936d47b32afe2c641c 100644 (file)
@@ -32,6 +32,7 @@
 #include <wx/renderer.h>
 #include <wx/grid.h>
 #include <boost/lexical_cast.hpp>
+#include <iostream>
 
 using std::cout;
 using std::list;
@@ -79,7 +80,7 @@ public:
                dc.SetBrush (*wxTheBrushList->FindOrCreateBrush (wxColour (255, 255, 255), wxBRUSHSTYLE_SOLID));
                dc.DrawRectangle (wxRect (rect.GetLeft() + xo, rect.GetTop() + yo, INDICATOR_SIZE, INDICATOR_SIZE));
 
-               float const value = lexical_cast<float> (wx_to_std (grid.GetCellValue (row, col)));
+               float const value = raw_convert<float> (wx_to_std (grid.GetCellValue (row, col)));
                float const value_dB = 20 * log10 (value);
                int const range = 18;
                int height = 0;
@@ -135,6 +136,7 @@ AudioMappingView::AudioMappingView (wxWindow* parent)
        Bind (wxEVT_GRID_CELL_LEFT_CLICK, boost::bind (&AudioMappingView::left_click, this, _1));
        Bind (wxEVT_GRID_CELL_RIGHT_CLICK, boost::bind (&AudioMappingView::right_click, this, _1));
        _grid->GetGridWindow()->Bind (wxEVT_MOTION, boost::bind (&AudioMappingView::mouse_moved, this, _1));
+       Bind (wxEVT_SIZE, boost::bind (&AudioMappingView::sized, this, _1));
 
        _menu = new wxMenu;
        _menu->Append (ID_off, _("Off"));
@@ -247,7 +249,7 @@ AudioMappingView::set_output_channels (vector<string> const & names)
                _grid->InsertCols (_grid->GetNumberCols(), o - _grid->GetNumberCols());
        }
 
-       _grid->SetColLabelValue (0, _("Content"));
+       _grid->SetColLabelValue (0, wxT (""));
 
        for (size_t i = 0; i < names.size(); ++i) {
                _grid->SetColLabelValue (i + 1, std_to_wx (names[i]));
@@ -324,3 +326,10 @@ AudioMappingView::mouse_moved (wxMouseEvent& ev)
 
         ev.Skip ();
 }
+
+void
+AudioMappingView::sized (wxSizeEvent& ev)
+{
+       _grid->AutoSize ();
+       ev.Skip ();
+}