mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-25 13:03:21 -04:00
Can now choose demodulator output devices
This commit is contained in:
@@ -21,10 +21,9 @@ wxEND_EVENT_TABLE()
|
||||
|
||||
ScopeCanvas::ScopeCanvas(wxWindow *parent, int *attribList) :
|
||||
wxGLCanvas(parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize,
|
||||
wxFULL_REPAINT_ON_RESIZE), parent(parent), frameTimer(0), stereo(false) {
|
||||
wxFULL_REPAINT_ON_RESIZE), parent(parent), stereo(false) {
|
||||
|
||||
glContext = new ScopeContext(this, &wxGetApp().GetContext(this));
|
||||
timer.start();
|
||||
}
|
||||
|
||||
ScopeCanvas::~ScopeCanvas() {
|
||||
@@ -39,6 +38,11 @@ void ScopeCanvas::setStereo(bool state) {
|
||||
stereo = state;
|
||||
}
|
||||
|
||||
void ScopeCanvas::setDeviceName(std::string device_name) {
|
||||
deviceName = device_name;
|
||||
deviceName.append(" ");
|
||||
}
|
||||
|
||||
void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
wxPaintDC dc(this);
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
@@ -47,17 +51,16 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
glViewport(0, 0, ClientSize.x, ClientSize.y);
|
||||
|
||||
glContext->DrawBegin();
|
||||
if (!deviceName.empty()) {
|
||||
glContext->DrawDeviceName(deviceName);
|
||||
}
|
||||
glContext->Plot(waveform_points, stereo);
|
||||
glContext->DrawEnd();
|
||||
|
||||
|
||||
SwapBuffers();
|
||||
}
|
||||
|
||||
void ScopeCanvas::OnIdle(wxIdleEvent &event) {
|
||||
// timer.update();
|
||||
// frameTimer += timer.lastUpdateSeconds();
|
||||
// if (frameTimer > 1.0/30.0) {
|
||||
Refresh(false);
|
||||
// frameTimer = 0;
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user