void-packages/srcpkgs/CubicSDR/patches/revert-migration-to-wx3.1.p...

726 lines
30 KiB
Diff

updated for 0.2.7.
From 531b4ef88b0e7f705c80272328d8588b916f9958 Mon Sep 17 00:00:00 2001
From: Andreas Bombe <aeb@debian.org>
Date: Mon, 11 Jun 2018 23:10:26 +0200
Subject: [PATCH] Revert "Migration to wxWidgets v3.11:"
This reverts commit e46d7f9735579d651664b6a1243d4b63a39bf109.
---
src/AppFrame.cpp | 8 ++++----
src/CubicSDR.cpp | 15 +--------------
src/CubicSDR.h | 7 +++----
src/ui/UITestCanvas.cpp | 4 ++--
src/ui/UITestCanvas.h | 2 +-
src/ui/UITestContext.cpp | 4 ++--
src/ui/UITestContext.h | 2 +-
src/util/GLExt.cpp | 3 +--
src/visual/GainCanvas.cpp | 4 ++--
src/visual/GainCanvas.h | 2 +-
src/visual/InteractiveCanvas.cpp | 6 +++---
src/visual/InteractiveCanvas.h | 2 +-
src/visual/MeterCanvas.cpp | 4 ++--
src/visual/MeterCanvas.h | 2 +-
src/visual/MeterContext.cpp | 4 ++--
src/visual/MeterContext.h | 2 +-
src/visual/ModeSelectorCanvas.cpp | 4 ++--
src/visual/ModeSelectorCanvas.h | 2 +-
src/visual/ModeSelectorContext.cpp | 4 ++--
src/visual/ModeSelectorContext.h | 2 +-
src/visual/PrimaryGLContext.cpp | 7 ++-----
src/visual/PrimaryGLContext.h | 2 +-
src/visual/ScopeCanvas.cpp | 4 ++--
src/visual/ScopeCanvas.h | 2 +-
src/visual/ScopeContext.cpp | 4 ++--
src/visual/ScopeContext.h | 2 +-
src/visual/SpectrumCanvas.cpp | 4 ++--
src/visual/SpectrumCanvas.h | 2 +-
src/visual/TuningCanvas.cpp | 5 +++--
src/visual/TuningCanvas.h | 2 +-
src/visual/TuningContext.cpp | 4 ++--
src/visual/TuningContext.h | 2 +-
src/visual/WaterfallCanvas.cpp | 5 +++--
src/visual/WaterfallCanvas.h | 2 +-
34 files changed, 57 insertions(+), 73 deletions(-)
--- a/src/AppFrame.cpp
+++ b/src/AppFrame.cpp
@@ -88,10 +88,10 @@ AppFrame::AppFrame() :
wxBoxSizer *demodScopeTray = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *demodTunerTray = new wxBoxSizer(wxHORIZONTAL);
- // OpenGL settings:
- //deprecated format: std::vector<int> attribList = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
- wxGLAttributes attribList;
- attribList.PlatformDefaults().RGBA().MinRGBA(8, 8, 8, 8).DoubleBuffer().EndList();
+ std::vector<int> attribList = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
+ //wxGLAttributes attribList;
+ //attribList.PlatformDefaults().RGBA().DoubleBuffer().EndList();
+ //attribList.PlatformDefaults().MinRGBA(8, 8, 8, 8).DoubleBuffer().Depth(16).EndList();
mainSplitter = new wxSplitterWindow( this, wxID_MAIN_SPLITTER, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH | wxSP_LIVE_UPDATE );
mainSplitter->SetSashGravity(10.0f / 37.0f);
--- a/src/CubicSDR.cpp
+++ b/src/CubicSDR.cpp
@@ -206,14 +206,6 @@ CubicSDR::CubicSDR() : frequency(0), off
shuttingDown.store(false);
fdlgTarget = FrequencyDialog::FDIALOG_TARGET_DEFAULT;
stoppedDev = nullptr;
-
- //set OpenGL configuration:
- m_glContextAttributes = new wxGLContextAttrs();
-
- wxGLContextAttrs glSettings;
- glSettings.PlatformDefaults().EndList();
-
- *m_glContextAttributes = glSettings;
}
bool CubicSDR::OnInit() {
@@ -503,18 +495,13 @@ int CubicSDR::OnExit() {
PrimaryGLContext& CubicSDR::GetContext(wxGLCanvas *canvas) {
PrimaryGLContext *glContext;
if (!m_glContext) {
- m_glContext = new PrimaryGLContext(canvas, nullptr, GetContextAttributes());
+ m_glContext = new PrimaryGLContext(canvas, nullptr);
}
glContext = m_glContext;
return *glContext;
}
-wxGLContextAttrs* CubicSDR::GetContextAttributes() {
-
- return m_glContextAttributes;
-}
-
void CubicSDR::OnInitCmdLine(wxCmdLineParser& parser) {
parser.SetDesc (commandLineInfo);
parser.SetSwitchChars (wxT("-"));
--- a/src/CubicSDR.h
+++ b/src/CubicSDR.h
@@ -71,7 +71,6 @@ public:
CubicSDR();
PrimaryGLContext &GetContext(wxGLCanvas *canvas);
- wxGLContextAttrs* GetContextAttributes();
virtual bool OnInit();
virtual int OnExit();
@@ -103,6 +102,8 @@ public:
void setSampleRate(long long rate_in);
long long getSampleRate();
+ void setDBOffset(int ofs);
+ int getDBOffset();
std::vector<SDRDeviceInfo *> *getDevices();
void setDevice(SDRDeviceInfo *dev, int waitMsForTermination);
@@ -188,8 +189,6 @@ private:
AppFrame *appframe = nullptr;
AppConfig config;
PrimaryGLContext *m_glContext = nullptr;
- wxGLContextAttrs *m_glContextAttributes = nullptr;
-
std::vector<SDRDeviceInfo *> *devs = nullptr;
DemodulatorMgr demodMgr;
--- a/src/ui/UITestCanvas.cpp
+++ b/src/ui/UITestCanvas.cpp
@@ -27,10 +27,10 @@ EVT_LEAVE_WINDOW(UITestCanvas::OnMouseLe
EVT_ENTER_WINDOW(UITestCanvas::OnMouseEnterWindow)
wxEND_EVENT_TABLE()
-UITestCanvas::UITestCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
+UITestCanvas::UITestCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
InteractiveCanvas(parent, dispAttrs) {
- glContext = new UITestContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
+ glContext = new UITestContext(this, &wxGetApp().GetContext(this));
}
UITestCanvas::~UITestCanvas() {
--- a/src/ui/UITestCanvas.h
+++ b/src/ui/UITestCanvas.h
@@ -17,7 +17,7 @@
class UITestCanvas: public InteractiveCanvas {
public:
- UITestCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
+ UITestCanvas(wxWindow *parent, std::vector<int> dispAttrs);
~UITestCanvas() override;
private:
--- a/src/ui/UITestContext.cpp
+++ b/src/ui/UITestContext.cpp
@@ -5,8 +5,8 @@
#include "UITestCanvas.h"
#include "ColorTheme.h"
-UITestContext::UITestContext(UITestCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs) :
-PrimaryGLContext(canvas, sharedContext, ctxAttrs), testMeter("TEST",0,100,50) {
+UITestContext::UITestContext(UITestCanvas *canvas, wxGLContext *sharedContext) :
+PrimaryGLContext(canvas, sharedContext), testMeter("TEST",0,100,50) {
testPanel.setPosition(0.0, 0.0);
testPanel.setSize(1.0, 1.0);
--- a/src/ui/UITestContext.h
+++ b/src/ui/UITestContext.h
@@ -11,7 +11,7 @@ class UITestCanvas;
class UITestContext: public PrimaryGLContext {
public:
- UITestContext(UITestCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs);
+ UITestContext(UITestCanvas *canvas, wxGLContext *sharedContext);
void DrawBegin();
void Draw();
--- a/src/util/GLExt.cpp
+++ b/src/util/GLExt.cpp
@@ -46,8 +46,7 @@ void initGLExtensions() {
#ifdef _WIN32
if (GLExtSupported("WGL_EXT_swap_control")) {
- std::cout << "Initializing WGL swap control extensions.." << std::endl << std::flush;
-
+ std::cout << "Initializing WGL swap control extensions.." << std::endl;
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) wglGetProcAddress("wglSwapIntervalEXT");
wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC) wglGetProcAddress("wglGetSwapIntervalEXT");
--- a/src/visual/GainCanvas.cpp
+++ b/src/visual/GainCanvas.cpp
@@ -29,10 +29,10 @@ EVT_ENTER_WINDOW(GainCanvas::OnMouseEnte
EVT_MOUSEWHEEL(GainCanvas::OnMouseWheelMoved)
wxEND_EVENT_TABLE()
-GainCanvas::GainCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
+GainCanvas::GainCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
InteractiveCanvas(parent, dispAttrs) {
- glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
+ glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this));
bgPanel.setCoordinateSystem(GLPanel::GLPANEL_Y_UP);
bgPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_X);
--- a/src/visual/GainCanvas.h
+++ b/src/visual/GainCanvas.h
@@ -21,7 +21,7 @@
class GainCanvas: public InteractiveCanvas {
public:
- GainCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
+ GainCanvas(wxWindow *parent, std::vector<int> dispAttrs);
~GainCanvas() override;
void setHelpTip(std::string tip);
--- a/src/visual/InteractiveCanvas.cpp
+++ b/src/visual/InteractiveCanvas.cpp
@@ -20,9 +20,9 @@
#include <wx/numformatter.h>
-InteractiveCanvas::InteractiveCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
- wxGLCanvas(parent, dispAttrs, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE),
- parent(parent), shiftDown(false), altDown(false), ctrlDown(false), centerFreq(0), bandwidth(0), lastBandwidth(0), isView(
+InteractiveCanvas::InteractiveCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
+ wxGLCanvas(parent, wxID_ANY, dispAttrs.data(), wxDefaultPosition, wxDefaultSize,
+ wxFULL_REPAINT_ON_RESIZE), parent(parent), shiftDown(false), altDown(false), ctrlDown(false), centerFreq(0), bandwidth(0), lastBandwidth(0), isView(
false) {
mouseTracker.setTarget(this);
}
--- a/src/visual/InteractiveCanvas.h
+++ b/src/visual/InteractiveCanvas.h
@@ -12,7 +12,7 @@
class InteractiveCanvas: public wxGLCanvas {
public:
- InteractiveCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
+ InteractiveCanvas(wxWindow *parent, std::vector<int> dispAttrs);
~InteractiveCanvas() override;
long long getFrequencyAt(float x);
--- a/src/visual/MeterCanvas.cpp
+++ b/src/visual/MeterCanvas.cpp
@@ -30,10 +30,10 @@ EVT_LEAVE_WINDOW(MeterCanvas::OnMouseLef
EVT_ENTER_WINDOW(MeterCanvas::OnMouseEnterWindow)
wxEND_EVENT_TABLE()
-MeterCanvas::MeterCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
+MeterCanvas::MeterCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
InteractiveCanvas(parent, dispAttrs), level(0), level_min(0), level_max(1), inputValue(0), userInputValue(0), showUserInput(true) {
- glContext = new MeterContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
+ glContext = new MeterContext(this, &wxGetApp().GetContext(this));
}
MeterCanvas::~MeterCanvas() {
--- a/src/visual/MeterCanvas.h
+++ b/src/visual/MeterCanvas.h
@@ -17,7 +17,7 @@
class MeterCanvas: public InteractiveCanvas {
public:
- MeterCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
+ MeterCanvas(wxWindow *parent, std::vector<int> dispAttrs);
~MeterCanvas() override;
void setLevel(float level_in);
--- a/src/visual/MeterContext.cpp
+++ b/src/visual/MeterContext.cpp
@@ -5,8 +5,8 @@
#include "MeterCanvas.h"
#include "ColorTheme.h"
-MeterContext::MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs) :
- PrimaryGLContext(canvas, sharedContext, ctxAttrs) {
+MeterContext::MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext) :
+ PrimaryGLContext(canvas, sharedContext) {
}
void MeterContext::DrawBegin() {
--- a/src/visual/MeterContext.h
+++ b/src/visual/MeterContext.h
@@ -12,7 +12,7 @@ class MeterCanvas;
class MeterContext: public PrimaryGLContext {
public:
- MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs);
+ MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext);
void DrawBegin();
void Draw(float r, float g, float b, float a, float level);
--- a/src/visual/ModeSelectorCanvas.cpp
+++ b/src/visual/ModeSelectorCanvas.cpp
@@ -27,10 +27,10 @@ EVT_LEAVE_WINDOW(ModeSelectorCanvas::OnM
EVT_ENTER_WINDOW(ModeSelectorCanvas::OnMouseEnterWindow)
wxEND_EVENT_TABLE()
-ModeSelectorCanvas::ModeSelectorCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
+ModeSelectorCanvas::ModeSelectorCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
InteractiveCanvas(parent, dispAttrs), numChoices(0), currentSelection(-1), toggleMode(false), inputChanged(false), padX(4.0), padY(4.0), highlightOverride(false) {
- glContext = new ModeSelectorContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
+ glContext = new ModeSelectorContext(this, &wxGetApp().GetContext(this));
highlightColor = RGBA4f(1.0,1.0,1.0,1.0);
}
--- a/src/visual/ModeSelectorCanvas.h
+++ b/src/visual/ModeSelectorCanvas.h
@@ -27,7 +27,7 @@ public:
class ModeSelectorCanvas: public InteractiveCanvas {
public:
- ModeSelectorCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
+ ModeSelectorCanvas(wxWindow *parent, std::vector<int> dispAttrs);
~ModeSelectorCanvas() override;
int getHoveredSelection();
--- a/src/visual/ModeSelectorContext.cpp
+++ b/src/visual/ModeSelectorContext.cpp
@@ -6,8 +6,8 @@
#include "ColorTheme.h"
-ModeSelectorContext::ModeSelectorContext(ModeSelectorCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs) :
- PrimaryGLContext(canvas, sharedContext, ctxAttrs) {
+ModeSelectorContext::ModeSelectorContext(ModeSelectorCanvas *canvas, wxGLContext *sharedContext) :
+ PrimaryGLContext(canvas, sharedContext) {
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
--- a/src/visual/ModeSelectorContext.h
+++ b/src/visual/ModeSelectorContext.h
@@ -12,7 +12,7 @@ class ModeSelectorCanvas;
class ModeSelectorContext: public PrimaryGLContext {
public:
- ModeSelectorContext(ModeSelectorCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs);
+ ModeSelectorContext(ModeSelectorCanvas *canvas, wxGLContext *sharedContext);
void DrawBegin();
void DrawSelector(std::string label, int c, int cMax, bool on, float r, float g, float b, float a, float padx, float pady);
--- a/src/visual/PrimaryGLContext.cpp
+++ b/src/visual/PrimaryGLContext.cpp
@@ -50,11 +50,8 @@ void PrimaryGLContext::CheckGLError() {
}
}
-PrimaryGLContext::PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs* ctxAttrs) :
- wxGLContext(canvas, sharedContext, (const wxGLContextAttrs*) ctxAttrs), hoverAlpha(1.0) {
-
-
-
+PrimaryGLContext::PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext) :
+ wxGLContext(canvas, sharedContext), hoverAlpha(1.0) {
//#ifndef __linux__
// SetCurrent(*canvas);
// // Pre-load fonts
--- a/src/visual/PrimaryGLContext.h
+++ b/src/visual/PrimaryGLContext.h
@@ -16,7 +16,7 @@
class PrimaryGLContext: public wxGLContext {
public:
- PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs* ctxAttrs);
+ PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext);
static wxString glGetwxString(GLenum name);
static void CheckGLError();
--- a/src/visual/ScopeCanvas.cpp
+++ b/src/visual/ScopeCanvas.cpp
@@ -31,9 +31,9 @@ EVT_LEAVE_WINDOW(ScopeCanvas::OnMouseLef
EVT_ENTER_WINDOW(ScopeCanvas::OnMouseEnterWindow)
wxEND_EVENT_TABLE()
-ScopeCanvas::ScopeCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) : InteractiveCanvas(parent, dispAttrs), ppmMode(false), ctr(0), ctrTarget(0), dragAccel(0) {
+ScopeCanvas::ScopeCanvas(wxWindow *parent, std::vector<int> dispAttrs) : InteractiveCanvas(parent, dispAttrs), ppmMode(false), ctr(0), ctrTarget(0), dragAccel(0) {
- glContext = new ScopeContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
+ glContext = new ScopeContext(this, &wxGetApp().GetContext(this));
inputData->set_max_num_items(2);
bgPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_Y);
bgPanel.setSize(1.0, 0.5f);
--- a/src/visual/ScopeCanvas.h
+++ b/src/visual/ScopeCanvas.h
@@ -18,7 +18,7 @@
class ScopeCanvas: public InteractiveCanvas {
public:
- ScopeCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
+ ScopeCanvas(wxWindow *parent, std::vector<int> dispAttrs);
~ScopeCanvas();
//This is public because it is indeed forwarded from
--- a/src/visual/ScopeContext.cpp
+++ b/src/visual/ScopeContext.cpp
@@ -6,8 +6,8 @@
#include "ScopeCanvas.h"
#include "ColorTheme.h"
-ScopeContext::ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs) :
- PrimaryGLContext(canvas, sharedContext, ctxAttrs) {
+ScopeContext::ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext) :
+ PrimaryGLContext(canvas, sharedContext) {
glDisable (GL_CULL_FACE);
glDisable (GL_DEPTH_TEST);
--- a/src/visual/ScopeContext.h
+++ b/src/visual/ScopeContext.h
@@ -12,7 +12,7 @@ class ScopeCanvas;
class ScopeContext: public PrimaryGLContext {
public:
- ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs);
+ ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext);
void DrawBegin(bool clear=true);
void DrawTunerTitles(bool ppmMode=false);
--- a/src/visual/SpectrumCanvas.cpp
+++ b/src/visual/SpectrumCanvas.cpp
@@ -32,10 +32,10 @@ EVT_RIGHT_DOWN(SpectrumCanvas::OnMouseRi
EVT_RIGHT_UP(SpectrumCanvas::OnMouseRightReleased)
wxEND_EVENT_TABLE()
-SpectrumCanvas::SpectrumCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
+SpectrumCanvas::SpectrumCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
InteractiveCanvas(parent, dispAttrs), waterfallCanvas(nullptr) {
- glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
+ glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this));
visualDataQueue->set_max_num_items(1);
--- a/src/visual/SpectrumCanvas.h
+++ b/src/visual/SpectrumCanvas.h
@@ -17,7 +17,7 @@ class WaterfallCanvas;
class SpectrumCanvas: public InteractiveCanvas {
public:
- SpectrumCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
+ SpectrumCanvas(wxWindow *parent, std::vector<int> dispAttrs);
~SpectrumCanvas() override;
//This is public because it is indeed forwarded from
--- a/src/visual/TuningCanvas.cpp
+++ b/src/visual/TuningCanvas.cpp
@@ -33,10 +33,10 @@ EVT_MOUSEWHEEL(TuningCanvas::OnMouseWhee
//EVT_KEY_UP(TuningCanvas::OnKeyUp)
wxEND_EVENT_TABLE()
-TuningCanvas::TuningCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
+TuningCanvas::TuningCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
InteractiveCanvas(parent, dispAttrs), dragAccum(0), uxDown(0), top(false), bottom(false), freq(-1), bw(-1), center(-1), halfBand(false) {
- glContext = new TuningContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
+ glContext = new TuningContext(this, &wxGetApp().GetContext(this));
hoverIndex = 0;
downIndex = 0;
@@ -272,6 +272,7 @@ void TuningCanvas::OnIdle(wxIdleEvent &e
if (mouseTracker.mouseInView() || changed()) {
Refresh();
}
+ event.RequestMore();
}
void TuningCanvas::OnMouseMoved(wxMouseEvent& event) {
--- a/src/visual/TuningCanvas.h
+++ b/src/visual/TuningCanvas.h
@@ -20,7 +20,7 @@ public:
enum ActiveState {
TUNING_HOVER_NONE, TUNING_HOVER_FREQ, TUNING_HOVER_BW, TUNING_HOVER_PPM, TUNING_HOVER_CENTER
};
- TuningCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
+ TuningCanvas(wxWindow *parent, std::vector<int> dispAttrs);
~TuningCanvas() override;
void setHelpTip(std::string tip);
--- a/src/visual/TuningContext.cpp
+++ b/src/visual/TuningContext.cpp
@@ -18,8 +18,8 @@ protected:
}
};
-TuningContext::TuningContext(TuningCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs) :
- PrimaryGLContext(canvas, sharedContext, ctxAttrs) {
+TuningContext::TuningContext(TuningCanvas *canvas, wxGLContext *sharedContext) :
+ PrimaryGLContext(canvas, sharedContext) {
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
--- a/src/visual/TuningContext.h
+++ b/src/visual/TuningContext.h
@@ -12,7 +12,7 @@ class TuningCanvas;
class TuningContext: public PrimaryGLContext {
public:
- TuningContext(TuningCanvas *canvas, wxGLContext *sharedContext, wxGLContextAttrs *ctxAttrs);
+ TuningContext(TuningCanvas *canvas, wxGLContext *sharedContext);
void DrawBegin();
void Draw(float r, float g, float b, float a, float p1, float p2);
--- a/src/visual/WaterfallCanvas.cpp
+++ b/src/visual/WaterfallCanvas.cpp
@@ -39,11 +39,11 @@ EVT_ENTER_WINDOW(WaterfallCanvas::OnMous
EVT_MOUSEWHEEL(WaterfallCanvas::OnMouseWheelMoved)
wxEND_EVENT_TABLE()
-WaterfallCanvas::WaterfallCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs) :
+WaterfallCanvas::WaterfallCanvas(wxWindow *parent, std::vector<int> dispAttrs) :
InteractiveCanvas(parent, dispAttrs), dragState(WF_DRAG_NONE), nextDragState(WF_DRAG_NONE), fft_size(0), new_fft_size(0), waterfall_lines(0),
dragOfs(0), mouseZoom(1), zoom(1), freqMoving(false), freqMove(0.0), hoverAlpha(1.0) {
- glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this), wxGetApp().GetContextAttributes());
+ glContext = new PrimaryGLContext(this, &wxGetApp().GetContext(this));
linesPerSecond = DEFAULT_WATERFALL_LPS;
lpsIndex = 0;
preBuf = false;
@@ -486,6 +486,7 @@ void WaterfallCanvas::OnKeyDown(wxKeyEve
void WaterfallCanvas::OnIdle(wxIdleEvent &event) {
processInputQueue();
Refresh();
+ event.RequestMore();
}
void WaterfallCanvas::updateHoverState() {
--- a/src/visual/WaterfallCanvas.h
+++ b/src/visual/WaterfallCanvas.h
@@ -21,7 +21,7 @@ public:
WF_DRAG_NONE, WF_DRAG_BANDWIDTH_LEFT, WF_DRAG_BANDWIDTH_RIGHT, WF_DRAG_FREQUENCY, WF_DRAG_RANGE
};
- WaterfallCanvas(wxWindow *parent, const wxGLAttributes& dispAttrs);
+ WaterfallCanvas(wxWindow *parent, std::vector<int> dispAttrs);
void setup(unsigned int fft_size_in, int waterfall_lines_in);
void setFFTSize(unsigned int fft_size_in);
~WaterfallCanvas();
--- a/src/AppFrame.h
+++ b/src/AppFrame.h
@@ -206,22 +206,22 @@
/**
* UI init functions
*/
- ModeSelectorCanvas *makeModemSelectorPanel(wxWindow *parent, const wxGLAttributes &attribList);
- WaterfallCanvas *makeWaterfallCanvas(wxWindow *parent, const wxGLAttributes &attribList);
- SpectrumCanvas *makeDemodSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList);
- MeterCanvas *makeSignalMeter(wxWindow *parent, const wxGLAttributes &attribList);
- ModeSelectorCanvas *makeDeltaLockButton(wxWindow *parent, const wxGLAttributes &attribList);
- TuningCanvas *makeModemTuner(wxWindow *parent, const wxGLAttributes &attribList);
- MeterCanvas *makeModemGainMeter(wxWindow *parent, const wxGLAttributes &attribList);
- ModeSelectorCanvas *makeSoloModeButton(wxWindow *parent, const wxGLAttributes &attribList);
- ModeSelectorCanvas *makeModemMuteButton(wxWindow *parent, const wxGLAttributes &attribList);
- ModeSelectorCanvas *makePeakHoldButton(wxWindow *parent, const wxGLAttributes &attribList);
- SpectrumCanvas *makeSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList);
- MeterCanvas *makeSpectrumAvgMeter(wxWindow *parent, const wxGLAttributes &attribList);
- WaterfallCanvas *makeWaterfall(wxWindow *parent, const wxGLAttributes &attribList);
- MeterCanvas *makeWaterfallSpeedMeter(wxWindow *parent, const wxGLAttributes &attribList);
- ScopeCanvas *makeScopeCanvas(wxPanel *parent, const wxGLAttributes &attribList);
- ModeSelectorCanvas *makeModemAdvSelectorPanel(wxPanel *parent, const wxGLAttributes &attribList);
+ ModeSelectorCanvas *makeModemSelectorPanel(wxWindow *parent, std::vector<int> attribList);
+ WaterfallCanvas *makeWaterfallCanvas(wxWindow *parent, std::vector<int> attribList);
+ SpectrumCanvas *makeDemodSpectrumCanvas(wxWindow *parent, std::vector<int> attribList);
+ MeterCanvas *makeSignalMeter(wxWindow *parent, std::vector<int> attribList);
+ ModeSelectorCanvas *makeDeltaLockButton(wxWindow *parent, std::vector<int> attribList);
+ TuningCanvas *makeModemTuner(wxWindow *parent, std::vector<int> attribList);
+ MeterCanvas *makeModemGainMeter(wxWindow *parent, std::vector<int> attribList);
+ ModeSelectorCanvas *makeSoloModeButton(wxWindow *parent, std::vector<int> attribList);
+ ModeSelectorCanvas *makeModemMuteButton(wxWindow *parent, std::vector<int> attribList);
+ ModeSelectorCanvas *makePeakHoldButton(wxWindow *parent, std::vector<int> attribList);
+ SpectrumCanvas *makeSpectrumCanvas(wxWindow *parent, std::vector<int> attribList);
+ MeterCanvas *makeSpectrumAvgMeter(wxWindow *parent, std::vector<int> attribList);
+ WaterfallCanvas *makeWaterfall(wxWindow *parent, std::vector<int> attribList);
+ MeterCanvas *makeWaterfallSpeedMeter(wxWindow *parent, std::vector<int> attribList);
+ ScopeCanvas *makeScopeCanvas(wxPanel *parent, std::vector<int> attribList);
+ ModeSelectorCanvas *makeModemAdvSelectorPanel(wxPanel *parent, std::vector<int> attribList);
ModemProperties *makeModemProperties(wxPanel *parent);
void initConfigurationSettings();
@@ -386,4 +386,4 @@
#define wxID_RIG_FOLLOW_MODEM 11906
#define wxID_RIG_SERIAL_BASE 11950
#define wxID_RIG_MODEL_BASE 12000
-#endif
\ No newline at end of file
+#endif
--- a/src/AppFrame.cpp
+++ b/src/AppFrame.cpp
@@ -461,7 +461,7 @@
return pProperties;
}
-ModeSelectorCanvas *AppFrame::makeModemAdvSelectorPanel(wxPanel *parent, const wxGLAttributes &attribList) {
+ModeSelectorCanvas *AppFrame::makeModemAdvSelectorPanel(wxPanel *parent, std::vector<int> attribList) {
auto *pCanvas = new ModeSelectorCanvas(parent, attribList);
pCanvas->addChoice("ASK");
pCanvas->addChoice("APSK");
@@ -577,7 +577,7 @@
#endif
-ScopeCanvas *AppFrame::makeScopeCanvas(wxPanel *parent, const wxGLAttributes &attribList) {
+ScopeCanvas *AppFrame::makeScopeCanvas(wxPanel *parent, std::vector<int> attribList) {
auto *pCanvas = new ScopeCanvas(parent, attribList);
pCanvas->setHelpTip("Audio Visuals, drag left/right to toggle Scope or Spectrum, 'B' to toggle decibels display.");
pCanvas->SetMinSize(wxSize(128, -1));
@@ -672,7 +672,7 @@
return pMenu;
}
-MeterCanvas *AppFrame::makeWaterfallSpeedMeter(wxWindow *parent, const wxGLAttributes &attribList) {
+MeterCanvas *AppFrame::makeWaterfallSpeedMeter(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new MeterCanvas(parent, attribList);
pCanvas->setHelpTip("Waterfall speed, click or drag to adjust (max 1024 lines per second)");
pCanvas->setMax(sqrt(1024));
@@ -682,13 +682,13 @@
return pCanvas;
}
-WaterfallCanvas *AppFrame::makeWaterfall(wxWindow *parent, const wxGLAttributes &attribList) {
+WaterfallCanvas *AppFrame::makeWaterfall(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new WaterfallCanvas(parent, attribList);
pCanvas->setup(DEFAULT_FFT_SIZE, DEFAULT_MAIN_WATERFALL_LINES_NB);
return pCanvas;
}
-MeterCanvas * AppFrame::makeSpectrumAvgMeter(wxWindow *parent, const wxGLAttributes &attribList) {
+MeterCanvas * AppFrame::makeSpectrumAvgMeter(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new MeterCanvas(parent, attribList);
pCanvas->setHelpTip("Spectrum averaging speed, click or drag to adjust.");
pCanvas->setMax(1.0);
@@ -698,7 +698,7 @@
return pCanvas;
}
-SpectrumCanvas *AppFrame::makeSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList) {
+SpectrumCanvas *AppFrame::makeSpectrumCanvas(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new SpectrumCanvas(parent, attribList);
pCanvas->setShowDb(true);
pCanvas->setUseDBOfs(true);
@@ -706,7 +706,7 @@
return pCanvas;
}
-ModeSelectorCanvas *AppFrame::makePeakHoldButton(wxWindow *parent, const wxGLAttributes &attribList) {
+ModeSelectorCanvas *AppFrame::makePeakHoldButton(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new ModeSelectorCanvas(parent, attribList);
pCanvas->addChoice(1, "P");
pCanvas->setPadding(-1, -1);
@@ -718,7 +718,7 @@
return pCanvas;
}
-ModeSelectorCanvas *AppFrame::makeModemMuteButton(wxWindow *parent, const wxGLAttributes &attribList) {
+ModeSelectorCanvas *AppFrame::makeModemMuteButton(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new ModeSelectorCanvas(parent, attribList);
pCanvas->addChoice(1, "M");
pCanvas->setPadding(-1, -1);
@@ -730,7 +730,7 @@
return pCanvas;
}
-ModeSelectorCanvas *AppFrame::makeSoloModeButton(wxWindow *parent, const wxGLAttributes &attribList) {
+ModeSelectorCanvas *AppFrame::makeSoloModeButton(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new ModeSelectorCanvas(parent, attribList);
pCanvas->addChoice(1, "S");
pCanvas->setPadding(-1, -1);
@@ -742,7 +742,7 @@
return pCanvas;
}
-MeterCanvas *AppFrame::makeModemGainMeter(wxWindow *parent, const wxGLAttributes &attribList) {
+MeterCanvas *AppFrame::makeModemGainMeter(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new MeterCanvas(parent, attribList);
pCanvas->setMax(2.0);
pCanvas->setHelpTip("Current Demodulator Gain Level. Click / Drag to set Gain level.");
@@ -751,13 +751,13 @@
return pCanvas;
}
-TuningCanvas *AppFrame::makeModemTuner(wxWindow *parent, const wxGLAttributes &attribList) {
+TuningCanvas *AppFrame::makeModemTuner(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new TuningCanvas(parent, attribList);
pCanvas->SetMinClientSize(wxSize(200, 28));
return pCanvas;
}
-ModeSelectorCanvas * AppFrame::makeDeltaLockButton(wxWindow *parent, const wxGLAttributes &attribList) {
+ModeSelectorCanvas * AppFrame::makeDeltaLockButton(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new ModeSelectorCanvas(parent, attribList);
pCanvas->addChoice(1, "V");
pCanvas->setPadding(-1, -1);
@@ -769,7 +769,7 @@
return pCanvas;
}
-MeterCanvas *AppFrame::makeSignalMeter(wxWindow *parent, const wxGLAttributes &attribList) {
+MeterCanvas *AppFrame::makeSignalMeter(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new MeterCanvas(parent, attribList);
pCanvas->setMax(DEMOD_SIGNAL_MAX);
pCanvas->setMin(DEMOD_SIGNAL_MIN);
@@ -780,13 +780,13 @@
return pCanvas;
}
-SpectrumCanvas *AppFrame::makeDemodSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList) {
+SpectrumCanvas *AppFrame::makeDemodSpectrumCanvas(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new SpectrumCanvas(parent, attribList);
pCanvas->setView(wxGetApp().getConfig()->getCenterFreq(), 300000);
return pCanvas;
}
-WaterfallCanvas *AppFrame::makeWaterfallCanvas(wxWindow *parent, const wxGLAttributes &attribList) {
+WaterfallCanvas *AppFrame::makeWaterfallCanvas(wxWindow *parent, std::vector<int> attribList) {
auto *pCanvas = new WaterfallCanvas(parent, attribList);
pCanvas->setup(DEFAULT_DMOD_FFT_SIZE, DEFAULT_DEMOD_WATERFALL_LINES_NB);
pCanvas->setView(wxGetApp().getConfig()->getCenterFreq(), 300000);
@@ -796,7 +796,7 @@
return pCanvas;
}
-ModeSelectorCanvas *AppFrame::makeModemSelectorPanel(wxWindow *parent, const wxGLAttributes &attribList) {
+ModeSelectorCanvas *AppFrame::makeModemSelectorPanel(wxWindow *parent, std::vector<int> attribList) {
vector<string> modemList = {"FM", "FMS", "NBFM", "AM", "CW", "LSB", "USB", "DSB", "I/Q" };
#ifdef CUBICSDR_MODEM_EXCLUDE