#pragma once #include "wx/glcanvas.h" #include "wx/timer.h" #include #include #include "CubicSDRDefs.h" #include "fftw3.h" #include "liquid/liquid.h" #include "portaudio.h" #ifdef WIN32 #include "pa_stream.h" #endif class PrimaryGLContext: public wxGLContext { public: PrimaryGLContext(wxGLCanvas *canvas); void Plot(std::vector &points, std::vector &points2); private: }; class TestGLCanvas: public wxGLCanvas { public: TestGLCanvas(wxWindow *parent, int *attribList = NULL); ~TestGLCanvas(); void setData(std::vector *data); std::queue< std::vector * > audio_queue; unsigned int audio_queue_ptr; private: void OnPaint(wxPaintEvent& event); void OnKeyDown(wxKeyEvent& event); void OnIdle(wxIdleEvent &event); wxWindow *parent; std::vector spectrum_points; std::vector waveform_points; fftw_complex *in, *out[2]; fftw_plan plan[2]; firfilt_crcf fir_filter; float pre_r; float pre_j; float droop_ofs, droop_ofs_ma, droop_ofs_maa; msresamp_crcf resampler; msresamp_crcf audio_resampler; float resample_ratio; freqdem fdem; float fft_ceil_ma, fft_ceil_maa; std::vector fft_result; std::vector fft_result_ma; std::vector fft_result_maa; unsigned int bandwidth; unsigned int audio_frequency; float audio_resample_ratio; PaStreamParameters outputParameters; PaStream *stream; wxDECLARE_EVENT_TABLE(); };