Set PPM via Tuning bar by holding ALT

This commit is contained in:
Charles J. Cliffe
2015-04-22 22:54:48 -04:00
parent 3241106bf7
commit a3a33eb3fe
11 changed files with 109 additions and 15 deletions
+10 -2
View File
@@ -21,7 +21,7 @@ wxEND_EVENT_TABLE()
ScopeCanvas::ScopeCanvas(wxWindow *parent, int *attribList) :
wxGLCanvas(parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize,
wxFULL_REPAINT_ON_RESIZE), parent(parent), stereo(false) {
wxFULL_REPAINT_ON_RESIZE), parent(parent), stereo(false), ppmMode(false) {
glContext = new ScopeContext(this, &wxGetApp().GetContext(this));
}
@@ -43,6 +43,14 @@ void ScopeCanvas::setDeviceName(std::string device_name) {
deviceName.append(" ");
}
void ScopeCanvas::setPPMMode(bool ppmMode) {
this->ppmMode = ppmMode;
}
bool ScopeCanvas::getPPMMode() {
return ppmMode;
}
void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
wxPaintDC dc(this);
#ifdef __APPLE__ // force half-rate?
@@ -75,7 +83,7 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
glViewport(0, 0, ClientSize.x, ClientSize.y);
glContext->DrawBegin();
glContext->Plot(waveform_points, stereo);
glContext->Plot(waveform_points, stereo, ppmMode);
if (!deviceName.empty()) {
glContext->DrawDeviceName(deviceName);
}