| 97 | |
| 98 | #include "../TrackPanelDrawingContext.h" |
| 99 | void EqualizationPanel::OnPaint(wxPaintEvent & WXUNUSED(event)) |
| 100 | { |
| 101 | const auto ¶meters = mCurvesList.mParameters; |
| 102 | const auto &dBMax = parameters.mdBMax; |
| 103 | const auto &dBMin = parameters.mdBMin; |
| 104 | const auto &M = parameters.mM; |
| 105 | const auto &drawMode = parameters.mDrawMode; |
| 106 | const auto &drawGrid = parameters.mDrawGrid; |
| 107 | const auto &loFreq = parameters.mLoFreq; |
| 108 | const auto &hiFreq = parameters.mHiFreq; |
| 109 | const auto &windowSize = parameters.mWindowSize; |
| 110 | const auto &filterFuncR = parameters.mFilterFuncR; |
| 111 | const auto &filterFuncI = parameters.mFilterFuncI; |
| 112 | |
| 113 | wxPaintDC dc(this); |
| 114 | int width, height; |
| 115 | GetSize(&width, &height); |
| 116 | |
| 117 | if (!mBitmap || mWidth!=width || mHeight!=height) |
| 118 | { |
| 119 | mWidth = width; |
| 120 | mHeight = height; |
| 121 | mBitmap = std::make_unique<wxBitmap>(mWidth, mHeight,24); |
| 122 | } |
| 123 | |
| 124 | wxBrush bkgndBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); |
| 125 | |
| 126 | wxMemoryDC memDC; |
| 127 | memDC.SelectObject(*mBitmap); |
| 128 | |
| 129 | wxRect bkgndRect; |
| 130 | bkgndRect.x = 0; |
| 131 | bkgndRect.y = 0; |
| 132 | bkgndRect.width = mWidth; |
| 133 | bkgndRect.height = mHeight; |
| 134 | memDC.SetBrush(bkgndBrush); |
| 135 | memDC.SetPen(*wxTRANSPARENT_PEN); |
| 136 | memDC.DrawRectangle(bkgndRect); |
| 137 | |
| 138 | bkgndRect.y = mHeight; |
| 139 | memDC.DrawRectangle(bkgndRect); |
| 140 | |
| 141 | wxRect border; |
| 142 | border.x = 0; |
| 143 | border.y = 0; |
| 144 | border.width = mWidth; |
| 145 | border.height = mHeight; |
| 146 | |
| 147 | memDC.SetBrush(*wxWHITE_BRUSH); |
| 148 | memDC.SetPen(*wxBLACK_PEN); |
| 149 | memDC.DrawRectangle(border); |
| 150 | |
| 151 | mEnvRect = border; |
| 152 | mEnvRect.Deflate(PANELBORDER, PANELBORDER); |
| 153 | |
| 154 | // Pure blue x-axis line |
| 155 | memDC.SetPen(wxPen(theTheme.Colour( clrGraphLines ), 1, wxPENSTYLE_SOLID)); |
| 156 | int center = (int) (mEnvRect.height * dBMax/(dBMax - dBMin) + .5); |