diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/wxmain.cpp | 8 | ||||
-rw-r--r-- | gui/wxmain_mrun.h | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/gui/wxmain.cpp b/gui/wxmain.cpp index 64f36e4..13d7586 100644 --- a/gui/wxmain.cpp +++ b/gui/wxmain.cpp @@ -258,8 +258,6 @@ void MainFrame::onPaint(wxPaintEvent&) dc->SetBrush(*wxBLACK_BRUSH); dc->SetPen(*wxBLACK_PEN); dc->DrawRectangle(rect); - dc->SetBrush(*wxRED_BRUSH); - dc->SetPen(*wxRED_PEN); auto stoy = [&](stmdsp::adcsample_t s) { return static_cast<float>(py) + rect.GetHeight() - (static_cast<float>(rect.GetHeight()) * s / 4095.f); @@ -268,15 +266,17 @@ void MainFrame::onPaint(wxPaintEvent&) float dx = static_cast<float>(rect.GetWidth()) / scount; float x = 0; float lasty = stoy(2048); + dc->SetBrush(wxBrush(wxColour(0xFF, 0, 0, 0x80))); + dc->SetPen(wxPen(wxColour(0xFF, 0, 0, 0x80))); for (decltype(scount) i = 0; i < scount; i++) { auto y = stoy(m_device_samples[i]); dc->DrawLine(x, lasty, x + dx, y); x += dx, lasty = y; } - dc->SetBrush(*wxBLUE_BRUSH); - dc->SetPen(*wxBLUE_PEN); x = 0; lasty = stoy(2048); + dc->SetBrush(wxBrush(wxColour(0, 0, 0xFF, 0x80))); + dc->SetPen(wxPen(wxColour(0, 0, 0xFF, 0x80))); for (decltype(scount) i = 0; i < scount; i++) { auto y = stoy(m_device_samples_input[i]); dc->DrawLine(x, lasty, x + dx, y); diff --git a/gui/wxmain_mrun.h b/gui/wxmain_mrun.h index b00898a..919b17d 100644 --- a/gui/wxmain_mrun.h +++ b/gui/wxmain_mrun.h @@ -103,6 +103,8 @@ void MainFrame::onRunEditBSize(wxCommandEvent&) if (wxString value = dialog.GetValue(); !value.IsEmpty()) { if (unsigned long n; value.ToULong(&n)) { if (n >= 100 && n <= stmdsp::SAMPLES_MAX) { + if (n & 1 == 1) + ++n; m_device->continuous_set_buffer_size(n); } else { m_status_bar->SetStatusText("Error: Invalid buffer size."); @@ -156,6 +158,9 @@ void MainFrame::onRunGenUpload(wxCommandEvent&) } if (samples.size() <= stmdsp::SAMPLES_MAX * 2) { + // DAC buffer must be of even size + if (samples.size() & 1 == 1) + samples.push_back(0); m_device->siggen_upload(&samples[0], samples.size()); m_status_bar->SetStatusText("Generator ready."); } else { |