Cleanup, reformat

This commit is contained in:
Charles J. Cliffe 2014-12-16 21:30:03 -05:00
parent a78651687a
commit 9e32ef478d
23 changed files with 348 additions and 368 deletions

View File

@ -61,10 +61,8 @@ AppFrame::AppFrame() :
Centre(); Centre();
Show(); Show();
GetStatusBar()->SetStatusText(wxString::Format(wxT("Set center frequency: %i"), DEFAULT_FREQ)); GetStatusBar()->SetStatusText(wxString::Format(wxT("Set center frequency: %i"), DEFAULT_FREQ));
// static const int attribs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 }; // static const int attribs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
// wxLogStatus("Double-buffered display %s supported", wxGLCanvas::IsDisplaySupported(attribs) ? "is" : "not"); // wxLogStatus("Double-buffered display %s supported", wxGLCanvas::IsDisplaySupported(attribs) ? "is" : "not");
// ShowFullScreen(true); // ShowFullScreen(true);

View File

@ -3,7 +3,6 @@
#include "wx/frame.h" #include "wx/frame.h"
#include "PrimaryGLContext.h" #include "PrimaryGLContext.h"
#include "ScopeCanvas.h" #include "ScopeCanvas.h"
#include "SpectrumCanvas.h" #include "SpectrumCanvas.h"
#include "WaterfallCanvas.h" #include "WaterfallCanvas.h"
@ -16,7 +15,6 @@ public:
void OnThread(wxCommandEvent& event); void OnThread(wxCommandEvent& event);
void OnEventInput(wxThreadEvent& event); void OnEventInput(wxThreadEvent& event);
private: private:
void OnClose(wxCommandEvent& event); void OnClose(wxCommandEvent& event);
void OnNewWindow(wxCommandEvent& event); void OnNewWindow(wxCommandEvent& event);
@ -26,7 +24,6 @@ private:
SpectrumCanvas *spectrumCanvas; SpectrumCanvas *spectrumCanvas;
WaterfallCanvas *waterfallCanvas; WaterfallCanvas *waterfallCanvas;
// event table // event table
wxDECLARE_EVENT_TABLE(); wxDECLARE_EVENT_TABLE();
}; };

View File

@ -24,9 +24,6 @@ bool CubicSDR::OnInit() {
audioVisualQueue = new DemodulatorThreadOutputQueue(); audioVisualQueue = new DemodulatorThreadOutputQueue();
audioVisualQueue->set_max_num_items(1); audioVisualQueue->set_max_num_items(1);
// demodulatorTest[0]->setVisualOutputQueue(audioVisualQueue);
// demodMgr.setActiveDemodulator(demodulatorTest[0]);
threadCmdQueueSDR = new SDRThreadCommandQueue; threadCmdQueueSDR = new SDRThreadCommandQueue;
sdrThread = new SDRThread(threadCmdQueueSDR); sdrThread = new SDRThread(threadCmdQueueSDR);

View File

@ -28,8 +28,7 @@ public:
class AudioThreadCommand { class AudioThreadCommand {
public: public:
enum AudioThreadCommandEnum { enum AudioThreadCommandEnum {
AUTIO_THREAD_CMD_NULL, AUTIO_THREAD_CMD_NULL, AUTIO_THREAD_CMD_SET_DEVICE,
AUTIO_THREAD_CMD_SET_DEVICE,
}; };
AudioThreadCommand() : AudioThreadCommand() :

View File

@ -8,8 +8,7 @@ enum DemodulatorType {
DEMOD_TYPE_NULL, DEMOD_TYPE_NULL,
DEMOD_TYPE_AM, DEMOD_TYPE_AM,
DEMOD_TYPE_FM, DEMOD_TYPE_FM,
DEMOD_TYPE_LSB, DEMOD_TYPE_LSB, DEMOD_TYPE_USB
DEMOD_TYPE_USB
}; };
class DemodulatorThread; class DemodulatorThread;
@ -69,7 +68,7 @@ public:
float resample_ratio; float resample_ratio;
msresamp_crcf resampler; msresamp_crcf resampler;
DemodulatorThreadPostIQData(): audio_resample_ratio(0), audio_resampler(NULL) { DemodulatorThreadPostIQData(): audio_resample_ratio(0), audio_resampler(NULL), resample_ratio(0), resampler(NULL) {
} }

View File

@ -45,11 +45,6 @@ public:
void updateLabel(int freq); void updateLabel(int freq);
private: private:
std::atomic<std::string *> label; std::atomic<std::string *> label;bool terminated;bool demodTerminated;bool audioTerminated;bool preDemodTerminated;
bool terminated;
bool demodTerminated;
bool audioTerminated;
bool preDemodTerminated;
}; };

View File

@ -1,4 +1,3 @@
#include "CubicSDRDefs.h" #include "CubicSDRDefs.h"
#include <vector> #include <vector>
@ -8,7 +7,8 @@
#include "DemodulatorPreThread.h" #include "DemodulatorPreThread.h"
DemodulatorPreThread::DemodulatorPreThread(DemodulatorThreadInputQueue* pQueueIn, DemodulatorThreadPostInputQueue* pQueueOut, DemodulatorThreadCommandQueue* threadQueueNotify) : DemodulatorPreThread::DemodulatorPreThread(DemodulatorThreadInputQueue* pQueueIn, DemodulatorThreadPostInputQueue* pQueueOut,
DemodulatorThreadCommandQueue* threadQueueNotify) :
inputQueue(pQueueIn), postInputQueue(pQueueOut), terminated(false), initialized(false), audio_resampler(NULL), resample_ratio(1), audio_resample_ratio( inputQueue(pQueueIn), postInputQueue(pQueueOut), terminated(false), initialized(false), audio_resampler(NULL), resample_ratio(1), audio_resample_ratio(
1), resampler(NULL), commandQueue(NULL), fir_filter(NULL), audioInputQueue(NULL), threadQueueNotify(threadQueueNotify) { 1), resampler(NULL), commandQueue(NULL), fir_filter(NULL), audioInputQueue(NULL), threadQueueNotify(threadQueueNotify) {
@ -98,7 +98,6 @@ void DemodulatorPreThread::threadMain() {
initialize(); initialize();
} }
std::cout << "Demodulator preprocessor thread started.." << std::endl; std::cout << "Demodulator preprocessor thread started.." << std::endl;
while (!terminated) { while (!terminated) {
DemodulatorThreadIQData inp; DemodulatorThreadIQData inp;

View File

@ -10,7 +10,8 @@
class DemodulatorPreThread { class DemodulatorPreThread {
public: public:
DemodulatorPreThread(DemodulatorThreadInputQueue* pQueueIn, DemodulatorThreadPostInputQueue* pQueueOut, DemodulatorThreadCommandQueue* threadQueueNotify); DemodulatorPreThread(DemodulatorThreadInputQueue* pQueueIn, DemodulatorThreadPostInputQueue* pQueueOut,
DemodulatorThreadCommandQueue* threadQueueNotify);
~DemodulatorPreThread(); ~DemodulatorPreThread();
#ifdef __APPLE__ #ifdef __APPLE__

View File

@ -17,15 +17,16 @@
class SDRThreadCommand { class SDRThreadCommand {
public: public:
enum SDRThreadCommandEnum { enum SDRThreadCommandEnum {
SDR_THREAD_CMD_NULL, SDR_THREAD_CMD_NULL, SDR_THREAD_CMD_TUNE
SDR_THREAD_CMD_TUNE
}; };
SDRThreadCommand() : cmd(SDR_THREAD_CMD_NULL), int_value(0) { SDRThreadCommand() :
cmd(SDR_THREAD_CMD_NULL), int_value(0) {
} }
SDRThreadCommand(SDRThreadCommandEnum cmd) : cmd(cmd), int_value(0) { SDRThreadCommand(SDRThreadCommandEnum cmd) :
cmd(cmd), int_value(0) {
} }
@ -39,7 +40,8 @@ public:
unsigned int bandwidth; unsigned int bandwidth;
std::vector<signed char> data; std::vector<signed char> data;
SDRThreadIQData(): frequency(0), bandwidth(0) { SDRThreadIQData() :
frequency(0), bandwidth(0) {
} }
@ -53,7 +55,6 @@ public:
} }
}; };
typedef ThreadQueue<SDRThreadCommand> SDRThreadCommandQueue; typedef ThreadQueue<SDRThreadCommand> SDRThreadCommandQueue;
typedef ThreadQueue<SDRThreadIQData> SDRThreadIQDataQueue; typedef ThreadQueue<SDRThreadIQData> SDRThreadIQDataQueue;

View File

@ -6,7 +6,6 @@
#include "lodepng.h" #include "lodepng.h"
#include "wx/glcanvas.h" #include "wx/glcanvas.h"
class GLFontChar { class GLFontChar {
public: public:
GLFontChar(); GLFontChar();
@ -53,11 +52,7 @@ private:
class GLFont { class GLFont {
public: public:
enum Align { enum Align {
GLFONT_ALIGN_LEFT, GLFONT_ALIGN_LEFT, GLFONT_ALIGN_RIGHT, GLFONT_ALIGN_CENTER, GLFONT_ALIGN_TOP, GLFONT_ALIGN_BOTTOM
GLFONT_ALIGN_RIGHT,
GLFONT_ALIGN_CENTER,
GLFONT_ALIGN_TOP,
GLFONT_ALIGN_BOTTOM
}; };
GLFont(); GLFont();

View File

@ -18,7 +18,7 @@ public:
void addColor(GradientColor c); void addColor(GradientColor c);
std::vector<float> &getRed();; std::vector<float> &getRed();
std::vector<float> &getGreen(); std::vector<float> &getGreen();
std::vector<float> &getBlue(); std::vector<float> &getBlue();

View File

@ -202,7 +202,6 @@ void PrimaryGLContext::DrawFreqSelector(float uxPos, float r, float g, float b,
bw = demod->getParams().bandwidth; bw = demod->getParams().bandwidth;
} }
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);

View File

@ -12,7 +12,9 @@
class PrimaryGLContext: public wxGLContext { class PrimaryGLContext: public wxGLContext {
public: public:
enum GLFontSize { GLFONT_SIZE12, GLFONT_SIZE16, GLFONT_SIZE18, GLFONT_SIZE24, GLFONT_SIZE32, GLFONT_SIZE48, GLFONT_MAX }; enum GLFontSize {
GLFONT_SIZE12, GLFONT_SIZE16, GLFONT_SIZE18, GLFONT_SIZE24, GLFONT_SIZE32, GLFONT_SIZE48, GLFONT_MAX
};
PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext); PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext);
static wxString glGetwxString(GLenum name); static wxString glGetwxString(GLenum name);

View File

@ -14,7 +14,9 @@
class WaterfallCanvas: public wxGLCanvas { class WaterfallCanvas: public wxGLCanvas {
public: public:
enum DragState { WF_DRAG_NONE, WF_DRAG_BANDWIDTH_LEFT, WF_DRAG_BANDWIDTH_RIGHT, WF_DRAG_FREQUENCY, WF_DRAG_RANGE }; enum DragState {
WF_DRAG_NONE, WF_DRAG_BANDWIDTH_LEFT, WF_DRAG_BANDWIDTH_RIGHT, WF_DRAG_FREQUENCY, WF_DRAG_RANGE
};
WaterfallCanvas(wxWindow *parent, int *attribList = NULL); WaterfallCanvas(wxWindow *parent, int *attribList = NULL);
~WaterfallCanvas(); ~WaterfallCanvas();
@ -60,9 +62,7 @@ private:
DragState dragState; DragState dragState;
DragState nextDragState; DragState nextDragState;
bool shiftDown; bool shiftDown;bool altDown;bool ctrlDown;
bool altDown;
bool ctrlDown;
// event table // event table
wxDECLARE_EVENT_TABLE(); wxDECLARE_EVENT_TABLE();
}; };

View File

@ -37,7 +37,6 @@ WaterfallContext::WaterfallContext(WaterfallCanvas *canvas, wxGLContext *sharedC
glPixelMapfv(GL_PIXEL_MAP_I_TO_B, 256, &(grad.getBlue())[0]); glPixelMapfv(GL_PIXEL_MAP_I_TO_B, 256, &(grad.getBlue())[0]);
} }
void WaterfallContext::Draw(std::vector<float> &points) { void WaterfallContext::Draw(std::vector<float> &points) {
if (points.size()) { if (points.size()) {

View File

@ -11,7 +11,6 @@ class WaterfallContext: public PrimaryGLContext {
public: public:
WaterfallContext(WaterfallCanvas *canvas, wxGLContext *sharedContext); WaterfallContext(WaterfallCanvas *canvas, wxGLContext *sharedContext);
void Draw(std::vector<float> &points); void Draw(std::vector<float> &points);
private: private: