mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-02 21:27:49 -04:00
AppFrame clean-up, first pass
This commit is contained in:
parent
c57a123130
commit
1f70f9189e
813
src/AppFrame.cpp
813
src/AppFrame.cpp
File diff suppressed because it is too large
Load Diff
@ -220,11 +220,6 @@ private:
|
|||||||
//Use a raw pointer here to prevent a dangling reference
|
//Use a raw pointer here to prevent a dangling reference
|
||||||
DemodulatorInstance* activeDemodulator;
|
DemodulatorInstance* activeDemodulator;
|
||||||
|
|
||||||
std::vector<RtAudio::DeviceInfo> devices;
|
|
||||||
std::map<int,RtAudio::DeviceInfo> inputDevices;
|
|
||||||
std::map<int,RtAudio::DeviceInfo> outputDevices;
|
|
||||||
|
|
||||||
std::map<int, wxMenuItem *> outputDeviceMenuItems;
|
|
||||||
std::map<int, wxMenuItem *> sampleRateMenuItems;
|
std::map<int, wxMenuItem *> sampleRateMenuItems;
|
||||||
std::map<int, wxMenuItem *> antennaMenuItems;
|
std::map<int, wxMenuItem *> antennaMenuItems;
|
||||||
|
|
||||||
@ -239,7 +234,6 @@ private:
|
|||||||
//
|
//
|
||||||
std::map<int, wxMenuItem *> recordingMenuItems;
|
std::map<int, wxMenuItem *> recordingMenuItems;
|
||||||
|
|
||||||
std::map<int, wxMenuItem *> directSamplingMenuItems;
|
|
||||||
wxMenuBar *menuBar;
|
wxMenuBar *menuBar;
|
||||||
|
|
||||||
wxMenu *sampleRateMenu = nullptr;
|
wxMenu *sampleRateMenu = nullptr;
|
||||||
@ -304,4 +298,29 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxDECLARE_EVENT_TABLE();
|
wxDECLARE_EVENT_TABLE();
|
||||||
|
|
||||||
|
ModeSelectorCanvas *makeModemSelectorPanel(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
WaterfallCanvas *makeWaterfallCanvas(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
SpectrumCanvas *makeDemodSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
MeterCanvas *makeSignalMeter(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
ModeSelectorCanvas *makeDeltaLockButton(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
TuningCanvas *makeModemTuner(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
MeterCanvas *makeModemGainMeter(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
ModeSelectorCanvas *makeSoloModeButton(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
ModeSelectorCanvas *makeModemMuteButton(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
ModeSelectorCanvas *makePeakHoldButton(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
SpectrumCanvas *makeSpectrumCanvas(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
MeterCanvas *makeSpectrumAvgMeter(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
WaterfallCanvas *makeWaterfall(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
MeterCanvas *makeWaterfallSpeedMeter(wxWindow *parent, const wxGLAttributes &attribList);
|
||||||
|
ScopeCanvas *makeScopeCanvas(wxPanel *parent, const wxGLAttributes &attribList);
|
||||||
|
ModeSelectorCanvas *makeModemAdvSelectorPanel(wxPanel *parent, const wxGLAttributes &attribList);
|
||||||
|
ModemProperties *makeModemProperties(wxPanel *parent);
|
||||||
|
|
||||||
|
wxMenu *makeAudioSampleRateMenu();
|
||||||
|
wxMenu *makeDisplayMenu();
|
||||||
|
#ifdef USE_HAMLIB
|
||||||
|
wxMenu *makeRigMenu();
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -216,6 +216,27 @@ CubicSDR::CubicSDR() : frequency(0), offset(0), ppm(0), snap(1), sampleRate(DEFA
|
|||||||
*m_glContextAttributes = glSettings;
|
*m_glContextAttributes = glSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CubicSDR::initAudioDevices() const {
|
||||||
|
std::vector<RtAudio::DeviceInfo> devices;
|
||||||
|
std::map<int, RtAudio::DeviceInfo> inputDevices, outputDevices;
|
||||||
|
|
||||||
|
AudioThread::enumerateDevices(devices);
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
for (auto devices_i = devices.begin(); devices_i != devices.end(); devices_i++) {
|
||||||
|
if (devices_i->inputChannels) {
|
||||||
|
inputDevices[i] = *devices_i;
|
||||||
|
}
|
||||||
|
if (devices_i->outputChannels) {
|
||||||
|
outputDevices[i] = *devices_i;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxGetApp().getDemodMgr().setOutputDevices(outputDevices);
|
||||||
|
}
|
||||||
|
|
||||||
bool CubicSDR::OnInit() {
|
bool CubicSDR::OnInit() {
|
||||||
|
|
||||||
//use the current locale most appropriate to this system,
|
//use the current locale most appropriate to this system,
|
||||||
@ -298,6 +319,8 @@ bool CubicSDR::OnInit() {
|
|||||||
devicesFailed.store(false);
|
devicesFailed.store(false);
|
||||||
deviceSelectorOpen.store(false);
|
deviceSelectorOpen.store(false);
|
||||||
|
|
||||||
|
initAudioDevices();
|
||||||
|
|
||||||
// Visual Data
|
// Visual Data
|
||||||
spectrumVisualThread = new SpectrumVisualDataThread();
|
spectrumVisualThread = new SpectrumVisualDataThread();
|
||||||
|
|
||||||
|
@ -248,6 +248,8 @@ private:
|
|||||||
RigThread* rigThread = nullptr;
|
RigThread* rigThread = nullptr;
|
||||||
std::thread *t_Rig = nullptr;
|
std::thread *t_Rig = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void initAudioDevices() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const wxCmdLineEntryDesc commandLineInfo [] =
|
static const wxCmdLineEntryDesc commandLineInfo [] =
|
||||||
|
@ -403,6 +403,10 @@ void DemodulatorMgr::setOutputDevices(std::map<int,RtAudio::DeviceInfo> devs) {
|
|||||||
outputDevices = devs;
|
outputDevices = devs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::map<int, RtAudio::DeviceInfo> DemodulatorMgr::getOutputDevices() {
|
||||||
|
return outputDevices;
|
||||||
|
}
|
||||||
|
|
||||||
void DemodulatorMgr::saveInstance(DataNode *node, DemodulatorInstancePtr inst) {
|
void DemodulatorMgr::saveInstance(DataNode *node, DemodulatorInstancePtr inst) {
|
||||||
|
|
||||||
*node->newChild("bandwidth") = inst->getBandwidth();
|
*node->newChild("bandwidth") = inst->getBandwidth();
|
||||||
|
@ -73,6 +73,7 @@ public:
|
|||||||
void updateLastState();
|
void updateLastState();
|
||||||
|
|
||||||
void setOutputDevices(std::map<int,RtAudio::DeviceInfo> devs);
|
void setOutputDevices(std::map<int,RtAudio::DeviceInfo> devs);
|
||||||
|
std::map<int, RtAudio::DeviceInfo> getOutputDevices();
|
||||||
void saveInstance(DataNode *node, DemodulatorInstancePtr inst);
|
void saveInstance(DataNode *node, DemodulatorInstancePtr inst);
|
||||||
|
|
||||||
DemodulatorInstancePtr loadInstance(DataNode *node);
|
DemodulatorInstancePtr loadInstance(DataNode *node);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user