-using boost::shared_ptr;
-
-#define INDICATOR_SIZE 16
-#define LEFT_WIDTH 48
-
-enum {
- ID_off = 1,
- ID_full = 2,
- ID_minus6dB = 3,
- ID_edit = 4
-};
-
-class NoSelectionStringRenderer : public wxGridCellStringRenderer
-{
-public:
- void Draw (wxGrid& grid, wxGridCellAttr& attr, wxDC& dc, const wxRect& rect, int row, int col, bool)
- {
- wxGridCellStringRenderer::Draw (grid, attr, dc, rect, row, col, false);
- }
-};
-
-/** @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)
- {
- dc.SetPen (*wxThePenList->FindOrCreatePen (wxColour (255, 255, 255), 1, wxPENSTYLE_SOLID));
- dc.SetBrush (*wxTheBrushList->FindOrCreateBrush (wxColour (255, 255, 255), wxBRUSHSTYLE_SOLID));
- dc.DrawRectangle (rect);
-
- int const xo = (rect.GetWidth() - INDICATOR_SIZE) / 2;
- int const yo = (rect.GetHeight() - INDICATOR_SIZE) / 2;
-
- dc.SetPen (*wxThePenList->FindOrCreatePen (wxColour (0, 0, 0), 1, wxPENSTYLE_SOLID));
- 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 = raw_convert<float> (wx_to_std (grid.GetCellValue (row, col)));
- float const value_dB = 20 * log10 (value);
- int const range = 18;
- int height = 0;
- if (value_dB > -range) {
- height = INDICATOR_SIZE * (1 + value_dB / range);
- }