mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-22 19:58:39 -05:00
Cleanup, reformat
This commit is contained in:
parent
a78651687a
commit
9e32ef478d
@ -61,10 +61,8 @@ AppFrame::AppFrame() :
|
||||
Centre();
|
||||
Show();
|
||||
|
||||
|
||||
GetStatusBar()->SetStatusText(wxString::Format(wxT("Set center frequency: %i"), DEFAULT_FREQ));
|
||||
|
||||
|
||||
// static const int attribs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
|
||||
// wxLogStatus("Double-buffered display %s supported", wxGLCanvas::IsDisplaySupported(attribs) ? "is" : "not");
|
||||
// ShowFullScreen(true);
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include "wx/frame.h"
|
||||
#include "PrimaryGLContext.h"
|
||||
|
||||
|
||||
#include "ScopeCanvas.h"
|
||||
#include "SpectrumCanvas.h"
|
||||
#include "WaterfallCanvas.h"
|
||||
@ -16,7 +15,6 @@ public:
|
||||
void OnThread(wxCommandEvent& event);
|
||||
void OnEventInput(wxThreadEvent& event);
|
||||
|
||||
|
||||
private:
|
||||
void OnClose(wxCommandEvent& event);
|
||||
void OnNewWindow(wxCommandEvent& event);
|
||||
@ -26,7 +24,6 @@ private:
|
||||
SpectrumCanvas *spectrumCanvas;
|
||||
WaterfallCanvas *waterfallCanvas;
|
||||
|
||||
|
||||
// event table
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
@ -24,9 +24,6 @@ bool CubicSDR::OnInit() {
|
||||
audioVisualQueue = new DemodulatorThreadOutputQueue();
|
||||
audioVisualQueue->set_max_num_items(1);
|
||||
|
||||
// demodulatorTest[0]->setVisualOutputQueue(audioVisualQueue);
|
||||
// demodMgr.setActiveDemodulator(demodulatorTest[0]);
|
||||
|
||||
threadCmdQueueSDR = new SDRThreadCommandQueue;
|
||||
sdrThread = new SDRThread(threadCmdQueueSDR);
|
||||
|
||||
|
@ -28,8 +28,7 @@ public:
|
||||
class AudioThreadCommand {
|
||||
public:
|
||||
enum AudioThreadCommandEnum {
|
||||
AUTIO_THREAD_CMD_NULL,
|
||||
AUTIO_THREAD_CMD_SET_DEVICE,
|
||||
AUTIO_THREAD_CMD_NULL, AUTIO_THREAD_CMD_SET_DEVICE,
|
||||
};
|
||||
|
||||
AudioThreadCommand() :
|
||||
|
@ -8,8 +8,7 @@ enum DemodulatorType {
|
||||
DEMOD_TYPE_NULL,
|
||||
DEMOD_TYPE_AM,
|
||||
DEMOD_TYPE_FM,
|
||||
DEMOD_TYPE_LSB,
|
||||
DEMOD_TYPE_USB
|
||||
DEMOD_TYPE_LSB, DEMOD_TYPE_USB
|
||||
};
|
||||
|
||||
class DemodulatorThread;
|
||||
@ -69,7 +68,7 @@ public:
|
||||
float resample_ratio;
|
||||
msresamp_crcf resampler;
|
||||
|
||||
DemodulatorThreadPostIQData(): audio_resample_ratio(0), audio_resampler(NULL) {
|
||||
DemodulatorThreadPostIQData(): audio_resample_ratio(0), audio_resampler(NULL), resample_ratio(0), resampler(NULL) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -45,11 +45,6 @@ public:
|
||||
void updateLabel(int freq);
|
||||
|
||||
private:
|
||||
std::atomic<std::string *> label;
|
||||
bool terminated;
|
||||
bool demodTerminated;
|
||||
bool audioTerminated;
|
||||
bool preDemodTerminated;
|
||||
std::atomic<std::string *> label;bool terminated;bool demodTerminated;bool audioTerminated;bool preDemodTerminated;
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
#include "CubicSDRDefs.h"
|
||||
#include <vector>
|
||||
|
||||
@ -8,7 +7,8 @@
|
||||
|
||||
#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(
|
||||
1), resampler(NULL), commandQueue(NULL), fir_filter(NULL), audioInputQueue(NULL), threadQueueNotify(threadQueueNotify) {
|
||||
|
||||
@ -98,7 +98,6 @@ void DemodulatorPreThread::threadMain() {
|
||||
initialize();
|
||||
}
|
||||
|
||||
|
||||
std::cout << "Demodulator preprocessor thread started.." << std::endl;
|
||||
while (!terminated) {
|
||||
DemodulatorThreadIQData inp;
|
||||
|
@ -10,7 +10,8 @@
|
||||
class DemodulatorPreThread {
|
||||
public:
|
||||
|
||||
DemodulatorPreThread(DemodulatorThreadInputQueue* pQueueIn, DemodulatorThreadPostInputQueue* pQueueOut, DemodulatorThreadCommandQueue* threadQueueNotify);
|
||||
DemodulatorPreThread(DemodulatorThreadInputQueue* pQueueIn, DemodulatorThreadPostInputQueue* pQueueOut,
|
||||
DemodulatorThreadCommandQueue* threadQueueNotify);
|
||||
~DemodulatorPreThread();
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
@ -17,15 +17,16 @@
|
||||
class SDRThreadCommand {
|
||||
public:
|
||||
enum SDRThreadCommandEnum {
|
||||
SDR_THREAD_CMD_NULL,
|
||||
SDR_THREAD_CMD_TUNE
|
||||
SDR_THREAD_CMD_NULL, 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;
|
||||
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<SDRThreadIQData> SDRThreadIQDataQueue;
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "lodepng.h"
|
||||
#include "wx/glcanvas.h"
|
||||
|
||||
|
||||
class GLFontChar {
|
||||
public:
|
||||
GLFontChar();
|
||||
@ -53,11 +52,7 @@ private:
|
||||
class GLFont {
|
||||
public:
|
||||
enum Align {
|
||||
GLFONT_ALIGN_LEFT,
|
||||
GLFONT_ALIGN_RIGHT,
|
||||
GLFONT_ALIGN_CENTER,
|
||||
GLFONT_ALIGN_TOP,
|
||||
GLFONT_ALIGN_BOTTOM
|
||||
GLFONT_ALIGN_LEFT, GLFONT_ALIGN_RIGHT, GLFONT_ALIGN_CENTER, GLFONT_ALIGN_TOP, GLFONT_ALIGN_BOTTOM
|
||||
};
|
||||
|
||||
GLFont();
|
||||
|
@ -18,7 +18,7 @@ public:
|
||||
|
||||
void addColor(GradientColor c);
|
||||
|
||||
std::vector<float> &getRed();;
|
||||
std::vector<float> &getRed();
|
||||
std::vector<float> &getGreen();
|
||||
std::vector<float> &getBlue();
|
||||
|
||||
|
@ -202,7 +202,6 @@ void PrimaryGLContext::DrawFreqSelector(float uxPos, float r, float g, float b,
|
||||
bw = demod->getParams().bandwidth;
|
||||
}
|
||||
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
|
@ -12,7 +12,9 @@
|
||||
|
||||
class PrimaryGLContext: public wxGLContext {
|
||||
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);
|
||||
|
||||
static wxString glGetwxString(GLenum name);
|
||||
|
@ -14,7 +14,9 @@
|
||||
|
||||
class WaterfallCanvas: public wxGLCanvas {
|
||||
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();
|
||||
@ -60,9 +62,7 @@ private:
|
||||
DragState dragState;
|
||||
DragState nextDragState;
|
||||
|
||||
bool shiftDown;
|
||||
bool altDown;
|
||||
bool ctrlDown;
|
||||
bool shiftDown;bool altDown;bool ctrlDown;
|
||||
// event table
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
@ -37,7 +37,6 @@ WaterfallContext::WaterfallContext(WaterfallCanvas *canvas, wxGLContext *sharedC
|
||||
glPixelMapfv(GL_PIXEL_MAP_I_TO_B, 256, &(grad.getBlue())[0]);
|
||||
}
|
||||
|
||||
|
||||
void WaterfallContext::Draw(std::vector<float> &points) {
|
||||
|
||||
if (points.size()) {
|
||||
|
@ -11,7 +11,6 @@ class WaterfallContext: public PrimaryGLContext {
|
||||
public:
|
||||
WaterfallContext(WaterfallCanvas *canvas, wxGLContext *sharedContext);
|
||||
|
||||
|
||||
void Draw(std::vector<float> &points);
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user