disable some more plug in code when plugin not present
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 20 Jan 2017 23:00:14 +0000 (23:00 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 20 Jan 2017 23:00:14 +0000 (23:00 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2996 01035d8c-6547-0410-b346-abe4f91aad63

freedv-dev/src/fdmdv2_main.cpp
freedv-dev/src/topFrame.cpp

index 0f2d96a2445ff89e174e815518aec426a4b2d171..337db40af87f05ad11e4028a011758ddf5eceb02 100644 (file)
@@ -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
index afa806a0d3eee5de3c4558c4bee188257f7a245c..01aaac6d31aab9b9a2bdad3e7adcbc3ba7ca4093 100644 (file)
@@ -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