blob: b0f73a68640a000d2721f95029f39de803d93b10 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#ifndef WXMAIN_HPP_
#define WXMAIN_HPP_
#include "stmdsp.hpp"
#include <future>
#include <thread>
#include <wx/button.h>
#include <wx/combobox.h>
#include <wx/dcclient.h>
#include <wx/filedlg.h>
#include <wx/font.h>
#include <wx/frame.h>
#include <wx/stattext.h>
#include <wx/stc/stc.h>
#include <wx/timer.h>
#include <wx/wfstream.h>
class MainFrame : public wxFrame
{
enum Id {
Single = 1,
ConnectDevice,
UploadFilter,
RenderTimer
};
bool m_is_rendering = false;
wxTimer *m_render_timer = nullptr;
wxComboBox *m_device_combo = nullptr;
wxStyledTextCtrl *m_text_editor = nullptr;
wxControl *m_signal_area = nullptr;
stmdsp::device *m_device = nullptr;
std::future<std::vector<stmdsp::adcsample_t>> m_device_samples_future;
std::vector<stmdsp::adcsample_t> m_device_samples;
bool tryDevice();
void prepareEditor();
wxString compileEditorCode();
public:
MainFrame();
void onPaint(wxPaintEvent& pe);
void onSinglePressed(wxCommandEvent& ce);
void onConnectPressed(wxCommandEvent& ce);
void onUploadPressed(wxCommandEvent& ce);
void onRenderTimer(wxTimerEvent& te);
void doSingle();
void updateDrawing();
};
#endif // WXMAIN_HPP_
|