From: drowe67 Date: Sat, 30 Jan 2016 21:45:48 +0000 (+0000) Subject: building up code to rename menu and param names based on plugin strings X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=61fd01fa3ed95384aaeb872552282b2f487d3a5d;p=freetel-svn-tracking.git building up code to rename menu and param names based on plugin strings git-svn-id: https://svn.code.sf.net/p/freetel/code@2672 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/freedv-dev/src/dlg_plugin.cpp b/freedv-dev/src/dlg_plugin.cpp index 5ec31ad3..1e243ee3 100644 --- a/freedv-dev/src/dlg_plugin.cpp +++ b/freedv-dev/src/dlg_plugin.cpp @@ -36,12 +36,13 @@ //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= // 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); diff --git a/freedv-dev/src/dlg_plugin.h b/freedv-dev/src/dlg_plugin.h index e9bcb66c..0f072655 100644 --- a/freedv-dev/src/dlg_plugin.h +++ b/freedv-dev/src/dlg_plugin.h @@ -40,17 +40,17 @@ //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= 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; diff --git a/freedv-dev/src/fdmdv2_defines.h b/freedv-dev/src/fdmdv2_defines.h index 86a41ae9..c1f8c327 100644 --- a/freedv-dev/src/fdmdv2_defines.h +++ b/freedv-dev/src/fdmdv2_defines.h @@ -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__ diff --git a/freedv-dev/src/fdmdv2_main.cpp b/freedv-dev/src/fdmdv2_main.cpp index 3f3464a8..00a41f26 100644 --- a/freedv-dev/src/fdmdv2_main.cpp +++ b/freedv-dev/src/fdmdv2_main.cpp @@ -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; } diff --git a/freedv-dev/src/fdmdv2_main.h b/freedv-dev/src/fdmdv2_main.h index 94e127ec..2f649035 100644 --- a/freedv-dev/src/fdmdv2_main.h +++ b/freedv-dev/src/fdmdv2_main.h @@ -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();