From: drowe67 Date: Fri, 30 May 2014 06:05:58 +0000 (+0000) Subject: added web integration dialog and persistant storgage for web integration. X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=bf6bca3d87ac5872f12377780d7cf33343694f8e;p=freetel-svn-tracking.git added web integration dialog and persistant storgage for web integration. git-svn-id: https://svn.code.sf.net/p/freetel/code@1615 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2/src/dlg_options.cpp b/fdmdv2/src/dlg_options.cpp index fbad7069..2fc010f7 100644 --- a/fdmdv2/src/dlg_options.cpp +++ b/fdmdv2/src/dlg_options.cpp @@ -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); diff --git a/fdmdv2/src/dlg_options.h b/fdmdv2/src/dlg_options.h index a85d354f..533f88ce 100644 --- a/fdmdv2/src/dlg_options.h +++ b/fdmdv2/src/dlg_options.h @@ -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; diff --git a/fdmdv2/src/fdmdv2_main.cpp b/fdmdv2/src/fdmdv2_main.cpp index 5de5d28c..906352f7 100644 --- a/fdmdv2/src/fdmdv2_main.cpp +++ b/fdmdv2/src/fdmdv2_main.cpp @@ -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); } diff --git a/fdmdv2/src/fdmdv2_main.h b/fdmdv2/src/fdmdv2_main.h index c6bf349a..1ed2d44d 100644 --- a/fdmdv2/src/fdmdv2_main.h +++ b/fdmdv2/src/fdmdv2_main.h @@ -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; diff --git a/fdmdv2/src/fdmdv2_pa_wrapper.cpp b/fdmdv2/src/fdmdv2_pa_wrapper.cpp index 97a58fc3..08120873 100644 --- a/fdmdv2/src/fdmdv2_pa_wrapper.cpp +++ b/fdmdv2/src/fdmdv2_pa_wrapper.cpp @@ -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,