From d83217f55dbd640f2c9e641ab8013af4c89c12dd Mon Sep 17 00:00:00 2001 From: drowe67 Date: Fri, 20 Jan 2017 23:00:14 +0000 Subject: [PATCH] disable some more plug in code when plugin not present git-svn-id: https://svn.code.sf.net/p/freetel/code@2996 01035d8c-6547-0410-b346-abe4f91aad63 --- freedv-dev/src/fdmdv2_main.cpp | 18 ++++++++++-------- freedv-dev/src/topFrame.cpp | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/freedv-dev/src/fdmdv2_main.cpp b/freedv-dev/src/fdmdv2_main.cpp index 0f2d96a2..337db40a 100644 --- a/freedv-dev/src/fdmdv2_main.cpp +++ b/freedv-dev/src/fdmdv2_main.cpp @@ -2367,7 +2367,7 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event) m_rb700b->Disable(); m_rb700c->Disable(); m_rb800xa->Disable(); - if (m_rbPlugIn) + if (m_rbPlugIn != NULL) m_rbPlugIn->Disable(); // determine what mode we are using @@ -2390,15 +2390,17 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event) if (m_rb800xa->GetValue()) { g_mode = FREEDV_MODE_800XA; } - if (m_rbPlugIn->GetValue()) { - g_mode = -1; /* TODO; a better way of handling (enumarating?) non-freedv modes */ + if (m_rbPlugIn != NULL) { + if (m_rbPlugIn->GetValue()) { + g_mode = -1; /* TODO; a better way of handling (enumarating?) non-freedv modes */ - /* scale plots assuming Fs = 8000 Hz for now */ + /* scale plots assuming Fs = 8000 Hz for now */ - m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ)/8000.0); - m_panelWaterfall->setFs(8000.0); + m_panelSpectrum->setFreqScale(MODEM_STATS_NSPEC*((float)MAX_F_HZ)/8000.0); + m_panelWaterfall->setFs(8000.0); - (wxGetApp().m_plugin_startfp)(wxGetApp().m_plugInStates); + (wxGetApp().m_plugin_startfp)(wxGetApp().m_plugInStates); + } } if (g_mode != -1) { @@ -2548,7 +2550,7 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event) m_rb700b->Enable(); m_rb700c->Enable(); m_rb800xa->Enable(); - if (m_rbPlugIn) + if (m_rbPlugIn != NULL) m_rbPlugIn->Enable(); #ifdef DISABLED_FEATURE diff --git a/freedv-dev/src/topFrame.cpp b/freedv-dev/src/topFrame.cpp index afa806a0..01aaac6d 100644 --- a/freedv-dev/src/topFrame.cpp +++ b/freedv-dev/src/topFrame.cpp @@ -324,6 +324,7 @@ TopFrame::TopFrame(wxString plugInName, wxWindow* parent, wxWindowID id, const w sbSizer_mode->Add(m_rb1600, 0, wxALIGN_LEFT|wxALL, 1); m_rb1600->SetValue(true); + m_rbPlugIn = NULL; if (!wxIsEmpty(plugInName)) { // Optional plug in -- 2.25.1