mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-02-03 09:44:26 -05:00
cleanup
This commit is contained in:
parent
00713c0259
commit
bab2ad3780
@ -561,12 +561,6 @@ void AppFrame::OnThread(wxCommandEvent& event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AppFrame::OnIdle(wxIdleEvent& event) {
|
void AppFrame::OnIdle(wxIdleEvent& event) {
|
||||||
bool work_done = false;
|
|
||||||
|
|
||||||
//#ifdef __APPLE__
|
|
||||||
// std::this_thread::sleep_for(std::chrono::milliseconds(4));
|
|
||||||
// std::this_thread::yield();
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
DemodulatorInstance *demod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
DemodulatorInstance *demod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
||||||
|
|
||||||
|
@ -12,13 +12,13 @@ std::map<int, int> AudioThread::deviceSampleRate;
|
|||||||
std::map<int, std::thread *> AudioThread::deviceThread;
|
std::map<int, std::thread *> AudioThread::deviceThread;
|
||||||
|
|
||||||
AudioThread::AudioThread() : IOThread(),
|
AudioThread::AudioThread() : IOThread(),
|
||||||
currentInput(NULL), inputQueue(NULL), gain(
|
currentInput(NULL), inputQueue(NULL), nBufferFrames(1024), threadQueueNotify(NULL), sampleRate(0) {
|
||||||
1.0), threadQueueNotify(NULL), sampleRate(0), nBufferFrames(1024) {
|
|
||||||
|
|
||||||
audioQueuePtr.store(0);
|
audioQueuePtr.store(0);
|
||||||
underflowCount.store(0);
|
underflowCount.store(0);
|
||||||
active.store(false);
|
active.store(false);
|
||||||
outputDevice.store(-1);
|
outputDevice.store(-1);
|
||||||
|
gain.store(1.0);
|
||||||
|
|
||||||
boundThreads = new std::vector<AudioThread *>;
|
boundThreads = new std::vector<AudioThread *>;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,6 @@ void DemodulatorThread::run() {
|
|||||||
} else if (demodulatorType == DEMOD_TYPE_RAW) {
|
} else if (demodulatorType == DEMOD_TYPE_RAW) {
|
||||||
// do nothing here..
|
// do nothing here..
|
||||||
} else {
|
} else {
|
||||||
float p;
|
|
||||||
switch (demodulatorType.load()) {
|
switch (demodulatorType.load()) {
|
||||||
case DEMOD_TYPE_LSB:
|
case DEMOD_TYPE_LSB:
|
||||||
for (int i = 0; i < bufSize; i++) { // Reject upper band
|
for (int i = 0; i < bufSize; i++) { // Reject upper band
|
||||||
|
@ -1598,8 +1598,8 @@ bool DataTree::LoadFromFile(const std::string& filename) {
|
|||||||
string compressionType(*header->getNext("compression"));
|
string compressionType(*header->getNext("compression"));
|
||||||
dataSize = *header->getNext("uncompressed_size");
|
dataSize = *header->getNext("uncompressed_size");
|
||||||
|
|
||||||
bool uncompress = false;
|
|
||||||
#if USE_FASTLZ
|
#if USE_FASTLZ
|
||||||
|
bool uncompress = false;
|
||||||
if (compressionType == "FastLZ") {
|
if (compressionType == "FastLZ") {
|
||||||
uncompress = true;
|
uncompress = true;
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,6 @@ void initGLExtensions() {
|
|||||||
|
|
||||||
std::cout << std::endl << "Supported GL Extensions: " << std::endl << extensions << std::endl << std::endl;
|
std::cout << std::endl << "Supported GL Extensions: " << std::endl << extensions << std::endl << std::endl;
|
||||||
|
|
||||||
int interval = 2;
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (GLExtSupported("WGL_EXT_swap_control")) {
|
if (GLExtSupported("WGL_EXT_swap_control")) {
|
||||||
std::cout << "Initializing WGL swap control extensions.." << std::endl;
|
std::cout << "Initializing WGL swap control extensions.." << std::endl;
|
||||||
|
@ -103,7 +103,7 @@ int GLFontChar::getIndex() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GLFont::GLFont() :
|
GLFont::GLFont() :
|
||||||
numCharacters(0), lineHeight(0), base(0), imageWidth(0), imageHeight(0), loaded(false), texId(0) {
|
lineHeight(0), base(0), imageWidth(0), imageHeight(0), loaded(false), texId(0) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,6 @@ private:
|
|||||||
std::string getParamKey(std::string param_str);
|
std::string getParamKey(std::string param_str);
|
||||||
std::string getParamValue(std::string param_str);
|
std::string getParamValue(std::string param_str);
|
||||||
|
|
||||||
int numCharacters;
|
|
||||||
int lineHeight;
|
int lineHeight;
|
||||||
int base;
|
int base;
|
||||||
int imageWidth, imageHeight;
|
int imageWidth, imageHeight;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "ColorTheme.h"
|
#include "ColorTheme.h"
|
||||||
|
|
||||||
SpectrumContext::SpectrumContext(SpectrumCanvas *canvas, wxGLContext *sharedContext) :
|
SpectrumContext::SpectrumContext(SpectrumCanvas *canvas, wxGLContext *sharedContext) :
|
||||||
PrimaryGLContext(canvas, sharedContext), fft_size(0), floorValue(0), ceilValue(1) {
|
PrimaryGLContext(canvas, sharedContext), floorValue(0), ceilValue(1) {
|
||||||
glDisable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
|
@ -19,6 +19,5 @@ public:
|
|||||||
void setCeilValue(float ceilValue);
|
void setCeilValue(float ceilValue);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int fft_size;
|
|
||||||
float floorValue, ceilValue;
|
float floorValue, ceilValue;
|
||||||
};
|
};
|
||||||
|
@ -31,7 +31,7 @@ EVT_KEY_UP(TuningCanvas::OnKeyUp)
|
|||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
TuningCanvas::TuningCanvas(wxWindow *parent, int *attribList) :
|
TuningCanvas::TuningCanvas(wxWindow *parent, int *attribList) :
|
||||||
InteractiveCanvas(parent, attribList), dragAccum(0), top(false), bottom(false), uxDown(0) {
|
InteractiveCanvas(parent, attribList), dragAccum(0), uxDown(0), top(false), bottom(false) {
|
||||||
|
|
||||||
glContext = new TuningContext(this, &wxGetApp().GetContext(this));
|
glContext = new TuningContext(this, &wxGetApp().GetContext(this));
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ wxEND_EVENT_TABLE()
|
|||||||
|
|
||||||
WaterfallCanvas::WaterfallCanvas(wxWindow *parent, int *attribList) :
|
WaterfallCanvas::WaterfallCanvas(wxWindow *parent, int *attribList) :
|
||||||
InteractiveCanvas(parent, attribList), dragState(WF_DRAG_NONE), nextDragState(WF_DRAG_NONE), fft_size(0), waterfall_lines(
|
InteractiveCanvas(parent, attribList), dragState(WF_DRAG_NONE), nextDragState(WF_DRAG_NONE), fft_size(0), waterfall_lines(
|
||||||
0), zoom(1), mouseZoom(1), hoverAlpha(1.0), dragOfs(0) {
|
0), mouseZoom(1), zoom(1), hoverAlpha(1.0), dragOfs(0) {
|
||||||
|
|
||||||
glContext = new WaterfallContext(this, &wxGetApp().GetContext(this));
|
glContext = new WaterfallContext(this, &wxGetApp().GetContext(this));
|
||||||
|
|
||||||
@ -173,7 +173,6 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
|||||||
int currentBandwidth = getBandwidth();
|
int currentBandwidth = getBandwidth();
|
||||||
long long currentCenterFreq = getCenterFrequency();
|
long long currentCenterFreq = getCenterFrequency();
|
||||||
|
|
||||||
float demodColor, selectorColor;
|
|
||||||
ColorTheme *currentTheme = ThemeMgr::mgr.currentTheme;
|
ColorTheme *currentTheme = ThemeMgr::mgr.currentTheme;
|
||||||
int last_type = wxGetApp().getDemodMgr().getLastDemodulatorType();
|
int last_type = wxGetApp().getDemodMgr().getLastDemodulatorType();
|
||||||
|
|
||||||
@ -260,13 +259,11 @@ void WaterfallCanvas::OnKeyUp(wxKeyEvent& event) {
|
|||||||
|
|
||||||
void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
|
void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
|
||||||
InteractiveCanvas::OnKeyDown(event);
|
InteractiveCanvas::OnKeyDown(event);
|
||||||
float angle = 5.0;
|
|
||||||
|
|
||||||
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getActiveDemodulator();
|
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getActiveDemodulator();
|
||||||
|
|
||||||
long long freq;
|
long long freq;
|
||||||
long long originalFreq;
|
long long originalFreq;
|
||||||
unsigned int bw;
|
|
||||||
switch (event.GetKeyCode()) {
|
switch (event.GetKeyCode()) {
|
||||||
case 'A':
|
case 'A':
|
||||||
zoom = 0.95;
|
zoom = 0.95;
|
||||||
@ -425,7 +422,6 @@ void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) {
|
|||||||
setStatusText("Click and drag to set the current demodulator range.");
|
setStatusText("Click and drag to set the current demodulator range.");
|
||||||
}
|
}
|
||||||
} else if (demodsHover->size() && !shiftDown) {
|
} else if (demodsHover->size() && !shiftDown) {
|
||||||
int hovered = -1;
|
|
||||||
long near_dist = getBandwidth();
|
long near_dist = getBandwidth();
|
||||||
|
|
||||||
DemodulatorInstance *activeDemodulator = NULL;
|
DemodulatorInstance *activeDemodulator = NULL;
|
||||||
|
@ -57,7 +57,6 @@ private:
|
|||||||
int waterfall_lines;
|
int waterfall_lines;
|
||||||
int dragOfs;
|
int dragOfs;
|
||||||
|
|
||||||
int lastInputBandwidth;
|
|
||||||
float mouseZoom, zoom;
|
float mouseZoom, zoom;
|
||||||
float hoverAlpha;
|
float hoverAlpha;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "CubicSDR.h"
|
#include "CubicSDR.h"
|
||||||
|
|
||||||
WaterfallContext::WaterfallContext(WaterfallCanvas *canvas, wxGLContext *sharedContext) :
|
WaterfallContext::WaterfallContext(WaterfallCanvas *canvas, wxGLContext *sharedContext) :
|
||||||
PrimaryGLContext(canvas, sharedContext), waterfall_lines(0), waterfall_slice(NULL), fft_size(0), activeTheme(NULL) {
|
PrimaryGLContext(canvas, sharedContext), fft_size(0), waterfall_lines(0), waterfall_slice(NULL), activeTheme(NULL) {
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
waterfall[i] = 0;
|
waterfall[i] = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user