plug in menu options noe depend on presence of plugin
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 20 Jan 2017 22:31:29 +0000 (22:31 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 20 Jan 2017 22:31:29 +0000 (22:31 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2995 01035d8c-6547-0410-b346-abe4f91aad63

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

index ef69c23b2d4cd66a9d7e35f767397d93f5774c2e..0f2d96a2445ff89e174e815518aec426a4b2d171 100644 (file)
@@ -130,7 +130,7 @@ SpeexPreprocessState *g_speex_st;
 // WxWidgets - initialize the application
 IMPLEMENT_APP(MainApp);
 
-FILE *ftest;
+//FILE *ftest;
 FILE *g_logfile;
 
 //-------------------------------------------------------------------------
@@ -170,10 +170,10 @@ bool MainApp::OnInit()
 
     m_plugIn = false;
     #ifdef __WXMSW__
-    wchar_t dll_path[] = L"/home/david/tmp/modem_api/afreedvplugin.dll";
+    wchar_t dll_path[] = L"afreedvplugin.dll";
     m_plugInHandle = LoadLibrary(dll_path);
     #else
-    m_plugInHandle = dlopen("/home/david/tmp/modem_api/afreedvplugin.so", RTLD_LAZY);
+    m_plugInHandle = dlopen("afreedvplugin.so", RTLD_LAZY);
     #endif
     
     if (m_plugInHandle) {
@@ -602,8 +602,8 @@ MainFrame::MainFrame(wxString plugInName, wxWindow *parent) : TopFrame(plugInNam
 
     vk_state = VK_IDLE;
 
-    ftest = fopen("ftest.raw", "wb");
-    assert(ftest != NULL);
+    //ftest = fopen("ftest.raw", "wb");
+    //assert(ftest != NULL);
 }
 
 //-------------------------------------------------------------------------
@@ -616,7 +616,7 @@ MainFrame::~MainFrame()
     int w;
     int h;
 
-    fclose(ftest);
+    //fclose(ftest);
     #ifdef __WXMSW__
     fclose(g_logfile);
     #endif
@@ -3616,7 +3616,7 @@ void per_frame_rx_processing(
             assert(nin <= freedv_get_n_max_modem_samples(g_pfreedv));
 
             nin_prev = nin;
-            fwrite(input_buf, sizeof(short), nin, ftest);
+            //fwrite(input_buf, sizeof(short), nin, ftest);
 
             // demod per frame processing
             for(i=0; i<nin; i++) {
index ad6b235412c73c91e58182924afea6194722a91d..afa806a0d3eee5de3c4558c4bee188257f7a245c 100644 (file)
@@ -69,8 +69,10 @@ TopFrame::TopFrame(wxString plugInName, wxWindow* parent, wxWindowID id, const w
     tools->Append(m_menuItemFilter);
 
     wxMenuItem* m_menuItemPlugIn;
-    m_menuItemPlugIn = new wxMenuItem(tools, wxID_ANY, plugInName + wxString(_(" Config")) , wxEmptyString, wxITEM_NORMAL);
-    tools->Append(m_menuItemPlugIn);
+    if (!wxIsEmpty(plugInName)) {
+        m_menuItemPlugIn = new wxMenuItem(tools, wxID_ANY, plugInName + wxString(_(" Config")) , wxEmptyString, wxITEM_NORMAL);
+        tools->Append(m_menuItemPlugIn);
+    }
 
     wxMenuItem* m_menuItemPlayFileToMicIn;
     m_menuItemPlayFileToMicIn = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File - Mic In")) , wxEmptyString, wxITEM_NORMAL);
@@ -322,10 +324,12 @@ TopFrame::TopFrame(wxString plugInName, wxWindow* parent, wxWindowID id, const w
     sbSizer_mode->Add(m_rb1600, 0, wxALIGN_LEFT|wxALL, 1);
     m_rb1600->SetValue(true);
 
-    // Optional plug in
+    if (!wxIsEmpty(plugInName)) {
+        // Optional plug in
 
-    m_rbPlugIn = new wxRadioButton( this, wxID_ANY, plugInName, wxDefaultPosition, wxDefaultSize, 0);
-    sbSizer_mode->Add(m_rbPlugIn, 0, wxALIGN_LEFT|wxALL, 1);
+        m_rbPlugIn = new wxRadioButton( this, wxID_ANY, plugInName, wxDefaultPosition, wxDefaultSize, 0);
+        sbSizer_mode->Add(m_rbPlugIn, 0, wxALIGN_LEFT|wxALL, 1);
+    }
 
 #ifdef DISABLED_FEATURE
     m_rb1600Wide = new wxRadioButton( this, wxID_ANY, wxT("1600 Wide"), wxDefaultPosition, wxDefaultSize, 0);
@@ -485,8 +489,10 @@ TopFrame::TopFrame(wxString plugInName, wxWindow* parent, wxWindowID id, const w
     this->Connect(m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsOptions));
     this->Connect(m_menuItemOptions->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsOptionsUI));
 
-    this->Connect(m_menuItemPlugIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsPlugInCfg));
-    this->Connect(m_menuItemPlugIn->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsPlugInCfgUI));
+    if (!wxIsEmpty(plugInName)) {
+        this->Connect(m_menuItemPlugIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnToolsPlugInCfg));
+        this->Connect(m_menuItemPlugIn->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TopFrame::OnToolsPlugInCfgUI));
+    }
 
     this->Connect(m_menuItemPlayFileToMicIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnPlayFileToMicIn));
     this->Connect(m_menuItemRecFileFromRadio->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(TopFrame::OnRecFileFromRadio));