building up code to rename menu and param names based on plugin strings
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 30 Jan 2016 21:45:48 +0000 (21:45 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 30 Jan 2016 21:45:48 +0000 (21:45 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2672 01035d8c-6547-0410-b346-abe4f91aad63

freedv-dev/src/dlg_plugin.cpp
freedv-dev/src/dlg_plugin.h
freedv-dev/src/fdmdv2_defines.h
freedv-dev/src/fdmdv2_main.cpp
freedv-dev/src/fdmdv2_main.h

index 5ec31ad3cef7836a5c7f750f5d503f5ffbec2673..1e243ee3f535ef7b7029e74960fd0ddab1b3e151 100644 (file)
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
 // Class PlugInDlg
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
-PlugInDlg::PlugInDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
+PlugInDlg::PlugInDlg(const wxString& title, int numParams, wxString params[], wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style)
 {
+
     wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
     this->SetSizer(mainSizer);
 
-    wxStaticBoxSizer* staticBoxSizer28a = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Param1")), wxVERTICAL);
+    wxStaticBoxSizer* staticBoxSizer28a = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, params[0]), wxVERTICAL);
     m_txtCtrlPlugIn1 = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300,-1), 0);
     staticBoxSizer28a->Add(m_txtCtrlPlugIn1, 0, 0, 5);
     mainSizer->Add(staticBoxSizer28a, 0, wxEXPAND, 5);
index e9bcb66c795f5e7ba0d365350623a37d8d2d1fe7..0f072655146848c7b5181972fd3e0c50f79ad55c 100644 (file)
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
 class PlugInDlg : public wxDialog
 {
-     public:
-        PlugInDlg(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plugin Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
+    public:
+    PlugInDlg(const wxString& title = _("PTT Config"), int numParams = 0, wxString params[]=NULL, wxWindow* parent=NULL, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
         virtual ~PlugInDlg();
         void    ExchangeData(int inout);
 
     protected:
-
         wxTextCtrl   *m_txtCtrlPlugIn1;
         wxTextCtrl   *m_txtCtrlPlugIn2;
         wxTextCtrl   *m_txtCtrlPlugIn3;
-        /* Ok - Cance */
+
+        /* Ok - Cancel */
 
         wxButton* m_buttonOK;
         wxButton* m_buttonCancel;
index 86a41ae96ce3839b5f2f2a58d9ddb750a6d40761..c1f8c3277d8c534421367312d1b0cc86ce7a8a7d 100644 (file)
@@ -98,5 +98,8 @@ enum
 #define CODEC2_LPC_PF_GAMMA 0.5
 #define CODEC2_LPC_PF_BETA  0.2
 
+// PlugIns ...
+
+#define PLUGIN_MAX_PARAMS 4
 
 #endif  //__FDMDV2_DEFINES__
index 3f3464a83b2767540046f495ad55d7f552767a8d..00a41f26b119d994881d3d6cead181eac74e2f66 100644 (file)
@@ -524,6 +524,14 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
     m_schedule_restore = false;
 
     vk_state = VK_IDLE;
+    
+    // Look for Plug In
+
+    m_plugIn = true;
+    m_plugInName = "MyModem";
+    m_numPlugInParams = 2;
+    m_plugInParams[0] = "Symbol Rate";
+    m_plugInParams[1] = "Num Tones";   
 }
 
 //-------------------------------------------------------------------------
@@ -2167,7 +2175,7 @@ void MainFrame::OnToolsComCfgUI(wxUpdateUIEvent& event)
 void MainFrame::OnToolsPlugInCfg(wxCommandEvent& event)
 {
     wxUnusedVar(event);
-    PlugInDlg *dlg = new PlugInDlg(NULL);
+    PlugInDlg *dlg = new PlugInDlg(m_plugInName, m_numPlugInParams, m_plugInParams);
     dlg->ShowModal();
     delete dlg;
 }
index 94e127ec1fd4b17de0e48ea4b1eb127920cb315c..2f649035ed11d9dc28ee7cd351b3246730269fb6 100644 (file)
@@ -578,6 +578,13 @@ class MainFrame : public TopFrame
         int        vk_rx_pause;
         int        vk_repeats, vk_repeat_counter;
         float      vk_rx_time;
+
+        // plugin details
+
+        bool       m_plugIn;
+        wxString   m_plugInName;
+        int        m_numPlugInParams;
+        wxString   m_plugInParams[PLUGIN_MAX_PARAMS];
 };
 
 void txRxProcessing();