added web integration dialog and persistant storgage for web integration.
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 30 May 2014 06:05:58 +0000 (06:05 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 30 May 2014 06:05:58 +0000 (06:05 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1615 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2/src/dlg_options.cpp
fdmdv2/src/dlg_options.h
fdmdv2/src/fdmdv2_main.cpp
fdmdv2/src/fdmdv2_main.h
fdmdv2/src/fdmdv2_pa_wrapper.cpp

index fbad7069d252c6483941acf281611ee25fa7c75a..2fc010f7f50dea0a9778d06f14740ac7b5be9fb8 100644 (file)
@@ -57,6 +57,23 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
 
     bSizer30->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
 
+    //------------------------------
+    // Web Integration
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_web;
+    sbSizer_web = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Web Integration")), wxVERTICAL);
+
+    m_txt_webURL = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
+    m_txt_webURL->SetToolTip(_("Hit this URL on action below"));
+    sbSizer_web->Add(m_txt_webURL, 1, wxEXPAND, 5);
+    m_ckbox_webOnStart = new wxCheckBox(this, wxID_ANY, _("Start Button"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_web->Add(m_ckbox_webOnStart, 1, wxEXPAND, 5);
+    m_ckbox_webOnPTT = new wxCheckBox(this, wxID_ANY, _("PTT Button"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_web->Add(m_ckbox_webOnPTT, 1, wxEXPAND, 5);
+
+    bSizer30->Add(sbSizer_web,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
     //------------------------------
     // Cancel - OK Buttons 
     //------------------------------
@@ -107,18 +124,27 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
     {
         m_txtCtrlCallSign->SetValue(wxGetApp().m_callSign);
         m_ckboxTestFrame->SetValue(wxGetApp().m_testFrames);
+
+        m_ckbox_webOnStart->SetValue(wxGetApp().m_webOnStart);
+        m_ckbox_webOnPTT->SetValue(wxGetApp().m_webOnPTT);
+        m_txt_webURL->SetValue(wxGetApp().m_webURL);
     }
 
     if(inout == EXCHANGE_DATA_OUT)
     {
-        // LPC Post filter
-
         wxGetApp().m_callSign   = m_txtCtrlCallSign->GetValue();
         wxGetApp().m_testFrames = m_ckboxTestFrame->GetValue();
 
+        wxGetApp().m_webOnStart = m_ckbox_webOnStart->GetValue();
+        wxGetApp().m_webOnPTT   = m_ckbox_webOnPTT->GetValue();
+        wxGetApp().m_webURL     = m_txt_webURL->GetValue();
+
         if (storePersistent) {
             pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
-            pConfig->Flush();
+            pConfig->Write(wxT("/Web/OnStart"), wxGetApp().m_webOnStart);
+            pConfig->Write(wxT("/Web/OnPTT"), wxGetApp().m_webOnPTT);
+            pConfig->Write(wxT("/Web/URL"), wxGetApp().m_webURL);
+             pConfig->Flush();
         }
     }
     delete wxConfigBase::Set((wxConfigBase *) NULL);
index a85d354f98e9080d16bf512566dcb33dceda3850..533f88ce5cf00c324d76c997d30c8788b524792c 100644 (file)
@@ -32,7 +32,7 @@ class OptionsDlg : public wxDialog
     public:
     OptionsDlg( wxWindow* parent,
                wxWindowID id = wxID_ANY, const wxString& title = _("Options"), 
-                const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,180), 
+                const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,290), 
                long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
         ~OptionsDlg();
 
@@ -48,6 +48,10 @@ class OptionsDlg : public wxDialog
         wxTextCtrl   *m_txtCtrlCallSign;
         wxCheckBox   *m_ckboxTestFrame;
 
+        wxCheckBox   *m_ckbox_webOnStart;
+        wxCheckBox   *m_ckbox_webOnPTT;
+        wxTextCtrl   *m_txt_webURL;
+
         wxButton*     m_sdbSizer5OK;
         wxButton*     m_sdbSizer5Cancel;
 
index 5de5d28c0b3a5ad2063523af385a7712a028c24d..906352f7e8c98810cf53903130597759137311d1 100644 (file)
@@ -370,6 +370,9 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
     wxGetApp().m_SpkOutEQEnable = (float)pConfig->Read(wxT("/Filter/SpkOutEQEnable"), f);
 
     wxGetApp().m_callSign = pConfig->Read("/Data/CallSign", wxT(""));
+    wxGetApp().m_webOnStart = pConfig->Read("/Web/OnStart", f);
+    wxGetApp().m_webOnPTT = pConfig->Read("/Web/OnPTT", f);
+    wxGetApp().m_webURL = pConfig->Read("/Web/URL", wxT("http://qso.freedv.org/cgi-bin/"));
 
     pConfig->SetPath(wxT("/"));
 
@@ -526,7 +529,10 @@ MainFrame::~MainFrame()
         pConfig->Write(wxT("/Audio/snrSlow"), wxGetApp().m_snrSlow);
 
         pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
-
+        pConfig->Write(wxT("/Web/OnStart"), wxGetApp().m_webOnStart);
+        pConfig->Write(wxT("/Web/OnPTT"), wxGetApp().m_webOnPTT);
+        pConfig->Write(wxT("/Web/URL"), wxGetApp().m_webURL);
         pConfig->Write(wxT("/Filter/MicInEQEnable"), wxGetApp().m_MicInEQEnable);
         pConfig->Write(wxT("/Filter/SpkOutEQEnable"), wxGetApp().m_SpkOutEQEnable);
     }
index c6bf349a6d8a5c80bb6b23bb4306a35d3b50ddcd..1ed2d44d3135d61d585ccb8382e8d21e9dc1ee5e 100644 (file)
@@ -170,6 +170,9 @@ class MainApp : public wxApp
         wxString            m_playFileFromRadioPath;
 
         wxString            m_callSign;
+        bool                m_webOnStart;
+        bool                m_webOnPTT;
+        wxString            m_webURL;
 
         bool                m_snrSlow;
 
@@ -336,8 +339,10 @@ class MainFrame : public TopFrame
 
         bool                    m_RxRunning;
 
-        PortAudioWrap           *m_rxPa;
-        PortAudioWrap           *m_txPa;
+        PortAudioWrap           *m_rxInPa;
+        PortAudioWrap           *m_rxOutPa;
+        PortAudioWrap           *m_txInPa;
+        PortAudioWrap           *m_txOutPa;
 
         PaError                 m_rxErr;
         PaError                 m_txErr;
index 97a58fc3cb6c437395ba3574521e69baa47b3673..08120873d673b95ce01a830bf2aa677f4501c730 100644 (file)
@@ -52,8 +52,8 @@ PaError PortAudioWrap::streamOpen()
 {
     return Pa_OpenStream(
                             &m_pStream,
-                            &m_inputBuffer,
-                            &m_outputBuffer,
+                            m_inputBuffer.device == paNoDevice ? NULL : &m_inputBuffer,
+                            m_outputBuffer.device == paNoDevice ? NULL : &m_outputBuffer,
                             m_samplerate,
                             m_framesPerBuffer,
                             m_statusFlags,