| 73 | #define APPFRAME_MODEMPROPS_MAXSIZE 240 |
| 74 | |
| 75 | AppFrame::AppFrame() : |
| 76 | wxFrame(nullptr, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(nullptr) { |
| 77 | |
| 78 | initIcon(); |
| 79 | |
| 80 | deviceChanged.store(false); |
| 81 | modemPropertiesUpdated.store(false); |
| 82 | |
| 83 | demodTray = new wxBoxSizer(wxHORIZONTAL); |
| 84 | auto *demodScopeTray = new wxBoxSizer(wxVERTICAL); |
| 85 | auto *demodTunerTray = new wxBoxSizer(wxHORIZONTAL); |
| 86 | |
| 87 | // OpenGL settings: |
| 88 | //deprecated format: std::vector<int> attribList = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 }; |
| 89 | wxGLAttributes attribList; |
| 90 | attribList.PlatformDefaults().RGBA().MinRGBA(8, 8, 8, 8).DoubleBuffer().EndList(); |
| 91 | |
| 92 | mainSplitter = new wxSplitterWindow( this, wxID_MAIN_SPLITTER, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH | wxSP_LIVE_UPDATE ); |
| 93 | mainSplitter->SetSashGravity(10.0f / 37.0f); |
| 94 | mainSplitter->SetMinimumPaneSize(1); |
| 95 | |
| 96 | auto *demodPanel = new wxPanel(mainSplitter, wxID_ANY); |
| 97 | |
| 98 | #ifdef CUBICSDR_HEADER_IMAGE |
| 99 | wxFileName exePath = wxFileName(wxStandardPaths::Get().GetExecutablePath()); |
| 100 | std::string headerPath = exePath.GetPath().ToStdString(); |
| 101 | headerPath += filePathSeparator + std::string("" CUBICSDR_HEADER_IMAGE); |
| 102 | wxInitAllImageHandlers(); |
| 103 | |
| 104 | ImagePanel *imgPanel = new ImagePanel(demodPanel, headerPath, wxBITMAP_TYPE_ANY); |
| 105 | |
| 106 | std::string headerBgColor = "" CUBICSDR_HEADER_BG; |
| 107 | if (headerBgColor != "") { |
| 108 | imgPanel->SetBackgroundColour(wxColour(headerBgColor)); |
| 109 | } |
| 110 | |
| 111 | imgPanel->SetBestFittingSize(wxSize(200, 0)); |
| 112 | |
| 113 | demodTray->Add(imgPanel, 0, wxEXPAND | wxALL, 0); |
| 114 | demodTray->AddSpacer(1); |
| 115 | #endif |
| 116 | |
| 117 | gainCanvas = new GainCanvas(demodPanel, attribList); |
| 118 | gainCanvas->setHelpTip("Tuner gains, usually in dB. Click / use Mousewheel to change."); |
| 119 | gainSizerItem = demodTray->Add(gainCanvas, 0, wxEXPAND | wxALL, 0); |
| 120 | gainSizerItem->Show(false); |
| 121 | gainSpacerItem = demodTray->AddSpacer(1); |
| 122 | gainSpacerItem->Show(false); |
| 123 | |
| 124 | // Demod mode selector |
| 125 | demodModeSelector = makeModemSelectorPanel(demodPanel, attribList); |
| 126 | |
| 127 | demodTray->Add(demodModeSelector, 2, wxEXPAND | wxALL, 0); |
| 128 | |
| 129 | #ifdef ENABLE_DIGITAL_LAB |
| 130 | // Digital Lab Mode Selector |
| 131 | demodModeSelectorAdv = makeModemAdvSelectorPanel(demodPanel, attribList); |
| 132 | demodTray->Add(demodModeSelectorAdv, 3, wxEXPAND | wxALL, 0); |
nothing calls this directly
no test coverage detected