2014-10-27 21:22:29 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "wx/glcanvas.h"
|
|
|
|
#include "wx/timer.h"
|
|
|
|
|
2014-10-28 22:59:17 -04:00
|
|
|
#include <vector>
|
2014-11-06 01:33:59 -05:00
|
|
|
#include <queue>
|
|
|
|
|
2014-10-30 22:51:33 -04:00
|
|
|
#include "CubicSDRDefs.h"
|
|
|
|
#include "fftw3.h"
|
2014-10-28 22:59:17 -04:00
|
|
|
|
2014-11-07 00:27:06 -05:00
|
|
|
#include "liquid/liquid.h"
|
2014-11-06 21:30:47 -05:00
|
|
|
|
2014-11-09 04:38:33 -05:00
|
|
|
#include "portaudio.h"
|
2014-11-09 05:18:33 -05:00
|
|
|
#ifdef WIN32
|
2014-11-09 04:38:33 -05:00
|
|
|
#include "pa_stream.h"
|
2014-11-09 05:18:33 -05:00
|
|
|
#endif
|
2014-11-05 19:10:18 -05:00
|
|
|
|
2014-11-04 19:52:11 -05:00
|
|
|
class PrimaryGLContext: public wxGLContext {
|
2014-10-27 21:22:29 -04:00
|
|
|
public:
|
|
|
|
PrimaryGLContext(wxGLCanvas *canvas);
|
|
|
|
|
2014-11-05 21:05:56 -05:00
|
|
|
void Plot(std::vector<float> &points, std::vector<float> &points2);
|
2014-10-27 21:22:29 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
};
|
|
|
|
|
2014-11-04 19:52:11 -05:00
|
|
|
class TestGLCanvas: public wxGLCanvas {
|
2014-10-27 21:22:29 -04:00
|
|
|
public:
|
|
|
|
TestGLCanvas(wxWindow *parent, int *attribList = NULL);
|
2014-11-05 19:10:18 -05:00
|
|
|
~TestGLCanvas();
|
2014-10-27 21:22:29 -04:00
|
|
|
|
2014-10-28 22:59:17 -04:00
|
|
|
void setData(std::vector<signed char> *data);
|
|
|
|
|
2014-11-09 04:38:33 -05:00
|
|
|
std::queue< std::vector <float> * > audio_queue;
|
|
|
|
unsigned int audio_queue_ptr;
|
|
|
|
|
2014-11-04 19:52:11 -05:00
|
|
|
private:
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
void OnKeyDown(wxKeyEvent& event);
|
|
|
|
|
|
|
|
void OnIdle(wxIdleEvent &event);
|
|
|
|
|
|
|
|
wxWindow *parent;
|
2014-11-05 18:12:42 -05:00
|
|
|
std::vector<float> spectrum_points;
|
|
|
|
std::vector<float> waveform_points;
|
2014-10-28 22:59:17 -04:00
|
|
|
|
2014-10-31 01:37:01 -04:00
|
|
|
fftw_complex *in, *out[2];
|
|
|
|
fftw_plan plan[2];
|
2014-10-30 22:51:33 -04:00
|
|
|
|
2014-11-06 21:30:47 -05:00
|
|
|
firfilt_crcf fir_filter;
|
|
|
|
|
2014-11-07 13:51:43 -05:00
|
|
|
float pre_r;
|
|
|
|
float pre_j;
|
|
|
|
float droop_ofs, droop_ofs_ma, droop_ofs_maa;
|
2014-11-07 01:47:57 -05:00
|
|
|
|
2014-11-08 17:08:00 -05:00
|
|
|
msresamp_crcf resampler;
|
|
|
|
msresamp_crcf audio_resampler;
|
|
|
|
float resample_ratio;
|
|
|
|
|
|
|
|
freqdem fdem;
|
|
|
|
|
2014-11-04 18:39:08 -05:00
|
|
|
float fft_ceil_ma, fft_ceil_maa;
|
|
|
|
|
2014-11-04 17:25:04 -05:00
|
|
|
std::vector<float> fft_result;
|
|
|
|
std::vector<float> fft_result_ma;
|
|
|
|
std::vector<float> fft_result_maa;
|
2014-10-28 22:59:17 -04:00
|
|
|
|
2014-11-09 04:38:33 -05:00
|
|
|
unsigned int bandwidth;
|
|
|
|
unsigned int audio_frequency;
|
|
|
|
float audio_resample_ratio;
|
2014-11-04 23:05:04 -05:00
|
|
|
|
2014-11-09 04:38:33 -05:00
|
|
|
PaStreamParameters outputParameters;
|
|
|
|
PaStream *stream;
|
2014-11-05 19:10:18 -05:00
|
|
|
|
2014-11-05 21:05:56 -05:00
|
|
|
|
2014-11-04 19:52:11 -05:00
|
|
|
wxDECLARE_EVENT_TABLE();
|
2014-10-27 21:22:29 -04:00
|
|
|
};
|