+ Bind (wxEVT_SIZE, boost::bind(&AudioMappingView::size, this, _1));
+ Bind (wxEVT_MENU, boost::bind(&AudioMappingView::set_gain_from_menu, this, 0), ID_off);
+ Bind (wxEVT_MENU, boost::bind(&AudioMappingView::set_gain_from_menu, this, db_to_linear(-6)), ID_minus6dB);
+ Bind (wxEVT_MENU, boost::bind(&AudioMappingView::set_gain_from_menu, this, 1), ID_0dB);
+ Bind (wxEVT_MENU, boost::bind(&AudioMappingView::set_gain_from_menu, this, db_to_linear(3)), ID_plus3dB);
+ Bind (wxEVT_MENU, boost::bind(&AudioMappingView::edit, this), ID_edit);
+ Bind (wxEVT_MOUSEWHEEL, boost::bind(&AudioMappingView::mouse_wheel, this, _1));
+ _body->Bind (wxEVT_PAINT, boost::bind(&AudioMappingView::paint, this));
+ _body->Bind (wxEVT_LEFT_DOWN, boost::bind(&AudioMappingView::left_down, this, _1));
+ _body->Bind (wxEVT_RIGHT_DOWN, boost::bind(&AudioMappingView::right_down, this, _1));
+ _body->Bind (wxEVT_MOTION, boost::bind(&AudioMappingView::motion, this, _1));
+ _vertical_scroll->Bind (wxEVT_SCROLL_TOP, boost::bind(&AudioMappingView::scroll, this));
+ _vertical_scroll->Bind (wxEVT_SCROLL_BOTTOM, boost::bind(&AudioMappingView::scroll, this));
+ _vertical_scroll->Bind (wxEVT_SCROLL_LINEUP, boost::bind(&AudioMappingView::scroll, this));
+ _vertical_scroll->Bind (wxEVT_SCROLL_LINEDOWN, boost::bind(&AudioMappingView::scroll, this));
+ _vertical_scroll->Bind (wxEVT_SCROLL_PAGEUP, boost::bind(&AudioMappingView::scroll, this));
+ _vertical_scroll->Bind (wxEVT_SCROLL_PAGEDOWN, boost::bind(&AudioMappingView::scroll, this));
+ _vertical_scroll->Bind (wxEVT_SCROLL_THUMBTRACK, boost::bind(&AudioMappingView::scroll, this));
+ _vertical_scroll->Bind (wxEVT_SCROLL_THUMBRELEASE, boost::bind(&AudioMappingView::scroll, this));
+ _horizontal_scroll->Bind (wxEVT_SCROLL_TOP, boost::bind(&AudioMappingView::scroll, this));
+ _horizontal_scroll->Bind (wxEVT_SCROLL_BOTTOM, boost::bind(&AudioMappingView::scroll, this));
+ _horizontal_scroll->Bind (wxEVT_SCROLL_LINEUP, boost::bind(&AudioMappingView::scroll, this));
+ _horizontal_scroll->Bind (wxEVT_SCROLL_LINEDOWN, boost::bind(&AudioMappingView::scroll, this));
+ _horizontal_scroll->Bind (wxEVT_SCROLL_PAGEUP, boost::bind(&AudioMappingView::scroll, this));
+ _horizontal_scroll->Bind (wxEVT_SCROLL_PAGEDOWN, boost::bind(&AudioMappingView::scroll, this));
+ _horizontal_scroll->Bind (wxEVT_SCROLL_THUMBTRACK, boost::bind(&AudioMappingView::scroll, this));
+ _horizontal_scroll->Bind (wxEVT_SCROLL_THUMBRELEASE, boost::bind(&AudioMappingView::scroll, this));
+}
+
+void
+AudioMappingView::size (wxSizeEvent& ev)
+{
+ setup ();
+ ev.Skip ();
+}
+
+void
+AudioMappingView::setup ()
+{
+ wxSize const s = GetSize();
+ int const w = _vertical_scroll->GetSize().GetWidth();
+ int const h = _horizontal_scroll->GetSize().GetHeight();
+
+ _vertical_scroll->SetPosition (wxPoint(s.GetWidth() - w, 0));
+ _vertical_scroll->SetSize (wxSize(w, max(0, s.GetHeight() - h)));
+
+ _body->SetSize (wxSize(max(0, s.GetWidth() - w), max(0, s.GetHeight() - h)));
+
+ _horizontal_scroll->SetPosition (wxPoint(0, s.GetHeight() - h));
+ _horizontal_scroll->SetSize (wxSize(max(0, s.GetWidth() - w), h));
+
+ _vertical_scroll->SetScrollbar (
+ _vertical_scroll->GetThumbPosition(),
+ s.GetHeight() - h - 8,
+ GRID_SPACING * (2 + _input_channels.size()),
+ GRID_SPACING,
+ true
+ );
+
+ _horizontal_scroll->SetScrollbar (
+ _horizontal_scroll->GetThumbPosition(),
+ s.GetWidth() - w - 8,
+ GRID_SPACING * (3 + _output_channels.size()),
+ GRID_SPACING,
+ true);
+}
+
+void
+AudioMappingView::scroll ()
+{
+ Refresh ();
+}
+
+void
+AudioMappingView::paint_static (wxDC& dc)