From 361b5b859b9257199cd15cfd48550dbe4ce6960d Mon Sep 17 00:00:00 2001 From: wittend99 Date: Thu, 1 Nov 2012 22:31:35 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/freetel/code@915 01035d8c-6547-0410-b346-abe4f91aad63 --- fdmdv2/build/fdmdv2.workspace | 4 +- fdmdv2/build/fdmdv2_wsp.mk | 4 +- fdmdv2/tests/pa_enum/AudioOptsDialog.cpp | 20 +++++---- fdmdv2/tests/pa_enum/main.cpp | 53 ++++++++++++++++++++++++ fdmdv2/tests/pa_enum/main.h | 7 ++++ fdmdv2/tests/pa_enum/pa_enum.mk | 18 ++++---- fdmdv2/tests/pa_enum/pa_enum.txt | 2 +- 7 files changed, 85 insertions(+), 23 deletions(-) diff --git a/fdmdv2/build/fdmdv2.workspace b/fdmdv2/build/fdmdv2.workspace index ff79c6f6..82b31d8a 100644 --- a/fdmdv2/build/fdmdv2.workspace +++ b/fdmdv2/build/fdmdv2.workspace @@ -8,13 +8,13 @@ - + - + diff --git a/fdmdv2/build/fdmdv2_wsp.mk b/fdmdv2/build/fdmdv2_wsp.mk index e7ba3f48..332ad0d5 100644 --- a/fdmdv2/build/fdmdv2_wsp.mk +++ b/fdmdv2/build/fdmdv2_wsp.mk @@ -1,8 +1,8 @@ .PHONY: clean All All: - @echo ----------Building project:[ pa_enum - Debug ]---------- + @echo ----------Building project:[ pa_enum - Release ]---------- @cd "C:\bin\Projects\Radio\fdmdv2\tests\pa_enum" && "$(MAKE)" -f "pa_enum.mk" clean: - @echo ----------Cleaning project:[ pa_enum - Debug ]---------- + @echo ----------Cleaning project:[ pa_enum - Release ]---------- @cd "C:\bin\Projects\Radio\fdmdv2\tests\pa_enum" && "$(MAKE)" -f "pa_enum.mk" clean diff --git a/fdmdv2/tests/pa_enum/AudioOptsDialog.cpp b/fdmdv2/tests/pa_enum/AudioOptsDialog.cpp index ae14e172..6cc35809 100644 --- a/fdmdv2/tests/pa_enum/AudioOptsDialog.cpp +++ b/fdmdv2/tests/pa_enum/AudioOptsDialog.cpp @@ -315,7 +315,7 @@ AudioOptsDialog::~AudioOptsDialog() void AudioOptsDialog::OnInitDialog( wxInitDialogEvent& event ) { ExchangeData(EXCHANGE_DATA_IN); - populateAudioInfo(); + //populateAudioInfo(); } //------------------------------------------------------------------------- @@ -326,17 +326,17 @@ void AudioOptsDialog::ExchangeData(int inout) wxConfigBase *pConfig = wxConfigBase::Get(); if(inout == EXCHANGE_DATA_IN) { - m_textRxInput->SetValue(wxGetApp().m_strRxInAudio); - m_textTxOutput->SetValue(wxGetApp().m_strRxOutAudio); - m_textVoiceInput->SetValue(wxGetApp().m_textVoiceInput); - m_textVoiceOutput->SetValue(wxGetApp().m_textVoiceOutput); + m_textCtrlRxIn->SetValue(wxGetApp().m_strRxInAudio); + m_textCtrlRxOut->SetValue(wxGetApp().m_strRxOutAudio); + m_textCtrlTxIn->SetValue(wxGetApp().m_textVoiceInput); + m_textCtrlTxOut->SetValue(wxGetApp().m_textVoiceOutput); } if(inout == EXCHANGE_DATA_OUT) { - wxGetApp().m_strRxInAudio = m_textRxInput->GetValue(); - wxGetApp().m_strRxOutAudio = m_textTxOutput->GetValue(); - wxGetApp().m_textVoiceInput = m_textVoiceInput->GetValue(); - wxGetApp().m_textVoiceOutput = m_textVoiceOutput->GetValue(); + wxGetApp().m_strRxInAudio = m_textCtrlRxIn->GetValue(); + wxGetApp().m_strRxOutAudio = m_textCtrlRxOut->GetValue(); + wxGetApp().m_textVoiceInput = m_textCtrlTxIn->GetValue(); + wxGetApp().m_textVoiceOutput = m_textCtrlTxOut->GetValue(); pConfig->Write(wxT("/Audio/RxIn"), wxGetApp().m_strRxInAudio); pConfig->Write(wxT("/Audio/RxOut"), wxGetApp().m_strRxOutAudio); @@ -665,6 +665,7 @@ void AudioOptsDialog::OnRefreshClick(wxCommandEvent& event) //------------------------------------------------------------------------- void AudioOptsDialog::OnApplyAudioParameters(wxCommandEvent& event) { + ExchangeData(EXCHANGE_DATA_OUT); if(m_isPaInitialized) { if((pa_err = Pa_Terminate()) == paNoError) @@ -702,6 +703,7 @@ void AudioOptsDialog::OnCancelAudioParameters(wxCommandEvent& event) //------------------------------------------------------------------------- void AudioOptsDialog::OnOkAudioParameters(wxCommandEvent& event) { + ExchangeData(EXCHANGE_DATA_OUT); if(m_isPaInitialized) { if((pa_err = Pa_Terminate()) == paNoError) diff --git a/fdmdv2/tests/pa_enum/main.cpp b/fdmdv2/tests/pa_enum/main.cpp index 90235bc2..f4ce742b 100644 --- a/fdmdv2/tests/pa_enum/main.cpp +++ b/fdmdv2/tests/pa_enum/main.cpp @@ -32,6 +32,32 @@ bool MainApp::OnInit() MainFrame::MainFrame(wxWindow *parent) : MainFrameBase(parent) { wxInitAllImageHandlers(); + wxConfigBase *pConfig = wxConfigBase::Get(); + + // restore frame position and size +// int x = pConfig->Read(wxT("/MainFrame/top"), 50); +// int y = pConfig->Read(wxT("/MainFrame/left"), 50); +// int w = pConfig->Read(wxT("/MainFrame/width"), 650); +// int h = pConfig->Read(wxT("/MainFrame/height"), 400); +// wxGetApp().m_show_wf = pConfig->Read(wxT("/MainFrame/show_wf"), 1); +// wxGetApp().m_show_spect = pConfig->Read(wxT("/MainFrame/show_spect"), 1); +// wxGetApp().m_show_scatter = pConfig->Read(wxT("/MainFrame/show_scatter"), 1); +// wxGetApp().m_show_timing = pConfig->Read(wxT("/MainFrame/show_timing"), 1); +// wxGetApp().m_show_freq = pConfig->Read(wxT("/MainFrame/show_freq"), 1); + + wxGetApp().m_strRxInAudio = pConfig->Read(wxT("/Audio/RxIn"), wxT("")); + wxGetApp().m_strRxOutAudio = pConfig->Read(wxT("/Audio/RxOut"), wxT("")); + wxGetApp().m_textVoiceInput = pConfig->Read(wxT("/Audio/TxIn"), wxT("")); + wxGetApp().m_textVoiceOutput = pConfig->Read(wxT("/Audio/TxOut"), wxT("")); + wxGetApp().m_strSampleRate = pConfig->Read(wxT("/Audio/SampleRate"), wxT("48000")); + +// wxGetApp().m_strRigCtrlPort = pConfig->Read("/Rig/Port", wxT("\\\\.\\com1")); +// wxGetApp().m_strRigCtrlBaud = pConfig->Read("/Rig/Baud", wxT("9600")); +// wxGetApp().m_strRigCtrlDatabits = pConfig->Read("/Rig/DataBits", wxT("8")); +// wxGetApp().m_strRigCtrlStopbits = pConfig->Read("/Rig/StopBits", wxT("1")); +// wxGetApp().m_strRigCtrlParity = pConfig->Read("/Rig/Parity", wxT("n")); + + pConfig->SetPath(wxT("/")); this->Connect(ID_AUDIO_OPTIONS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnAudioOptsDialog)); } @@ -42,6 +68,33 @@ MainFrame::MainFrame(wxWindow *parent) : MainFrameBase(parent) MainFrame::~MainFrame() { this->Disconnect(ID_AUDIO_OPTIONS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnAudioOptsDialog)); + wxConfigBase *pConfig = wxConfigBase::Get(); + if(pConfig) + { +// GetClientSize(&w, &h); +// GetPosition(&x, &y); +// pConfig->Write(wxT("/MainFrame/top"), (long) x); +// pConfig->Write(wxT("/MainFrame/left"), (long) y); +// pConfig->Write(wxT("/MainFrame/width"), (long) w); +// pConfig->Write(wxT("/MainFrame/height"), (long) h); +// pConfig->Write(wxT("/MainFrame/show_wf"), wxGetApp().m_show_wf); +// pConfig->Write(wxT("/MainFrame/show_spect"), wxGetApp().m_show_spect); +// pConfig->Write(wxT("/MainFrame/show_scatter"), wxGetApp().m_show_scatter); +// pConfig->Write(wxT("/MainFrame/show_timing"), wxGetApp().m_show_timing); +// pConfig->Write(wxT("/MainFrame/show_freq"), wxGetApp().m_show_freq); + + pConfig->Write(wxT("/Audio/RxIn"), wxGetApp().m_strRxInAudio); + pConfig->Write(wxT("/Audio/RxOut"), wxGetApp().m_strRxOutAudio); + pConfig->Write(wxT("/Audio/TxIn"), wxGetApp().m_textVoiceInput); + pConfig->Write(wxT("/Audio/TxOut"), wxGetApp().m_textVoiceOutput); + pConfig->Write(wxT("/Audio/SampleRate"), wxGetApp().m_strSampleRate); + +// pConfig->Write(wxT("/Rig/Port"), wxGetApp().m_strRigCtrlPort); +// pConfig->Write(wxT("/Rig/Baud"), wxGetApp().m_strRigCtrlBaud); +// pConfig->Write(wxT("/Rig/DataBits"), wxGetApp().m_strRigCtrlDatabits); +// pConfig->Write(wxT("/Rig/StopBits"), wxGetApp().m_strRigCtrlStopbits); +// pConfig->Write(wxT("/Rig/Parity"), wxGetApp().m_strRigCtrlParity); + } } //------------------------------------------------------------------------- diff --git a/fdmdv2/tests/pa_enum/main.h b/fdmdv2/tests/pa_enum/main.h index cecba295..48b6809f 100644 --- a/fdmdv2/tests/pa_enum/main.h +++ b/fdmdv2/tests/pa_enum/main.h @@ -18,6 +18,7 @@ #include #include #include +#include "wx/config.h" #include #include #include @@ -48,6 +49,12 @@ class MainApp : public wxApp { public: virtual bool OnInit(); + wxString m_strRxInAudio; + wxString m_strRxOutAudio; + wxString m_textVoiceInput; + wxString m_textVoiceOutput; + wxString m_strSampleRate; + wxString m_strBitrate; }; // declare global static function wxGetApp() diff --git a/fdmdv2/tests/pa_enum/pa_enum.mk b/fdmdv2/tests/pa_enum/pa_enum.mk index 25bbabb8..3bdad048 100644 --- a/fdmdv2/tests/pa_enum/pa_enum.mk +++ b/fdmdv2/tests/pa_enum/pa_enum.mk @@ -2,18 +2,18 @@ ## Auto Generated makefile by CodeLite IDE ## any manual changes will be erased ## -## Debug +## Release ProjectName :=pa_enum -ConfigurationName :=Debug +ConfigurationName :=Release WorkspacePath := "C:\bin\Projects\Radio\fdmdv2\build" ProjectPath := "C:\bin\Projects\Radio\fdmdv2\tests\pa_enum" -IntermediateDirectory :=./Debug +IntermediateDirectory :=./Release OutDir := $(IntermediateDirectory) CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=OFA-Staff -Date :=10/26/2012 +Date :=11/1/2012 CodeLitePath :="C:\bin\CodeLite" LinkerName :=g++ SharedObjectLinkerName :=g++ -shared -fPIC @@ -35,7 +35,7 @@ PreprocessOnlySwitch :=-E ObjectsFileList :="C:\bin\Projects\Radio\fdmdv2\tests\pa_enum\pa_enum.txt" PCHCompileFlags := MakeDirCommand :=makedir -LinkOptions := -mwindows $(shell wx-config --debug=yes --libs --unicode=yes) +LinkOptions := -mwindows -s $(shell wx-config --debug=no --libs --unicode=yes) IncludePath := $(IncludeSwitch). $(IncludeSwitch)/bin/MinGW-4.6.1/msys/1.0/local/include $(IncludeSwitch)../../codec2-dev/src $(IncludeSwitch)/bin/Projects/Audio/libsndfile/ IncludePCH := RcIncludePath := @@ -50,8 +50,8 @@ LibPath := $(LibraryPathSwitch). $(LibraryPathSwitch)/bin/MinGW-4 AR := ar rcus CXX := g++ CC := gcc -CXXFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"824\" $(Preprocessors) -CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"824\" $(Preprocessors) +CXXFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) -DSVN_REVISION=\"886\" $(Preprocessors) +CFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) -DSVN_REVISION=\"886\" $(Preprocessors) ## @@ -77,7 +77,7 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) $(IntermediateDirectory)/.d: - @$(MakeDirCommand) "./Debug" + @$(MakeDirCommand) "./Release" PreBuild: @@ -126,6 +126,6 @@ clean: $(RM) $(IntermediateDirectory)/AudioOptsDialog$(PreprocessSuffix) $(RM) $(OutputFile) $(RM) $(OutputFile).exe - $(RM) "C:\bin\Projects\Radio\fdmdv2\build\.build-debug\pa_enum" + $(RM) "C:\bin\Projects\Radio\fdmdv2\build\.build-release\pa_enum" diff --git a/fdmdv2/tests/pa_enum/pa_enum.txt b/fdmdv2/tests/pa_enum/pa_enum.txt index b01c823d..f7a90027 100644 --- a/fdmdv2/tests/pa_enum/pa_enum.txt +++ b/fdmdv2/tests/pa_enum/pa_enum.txt @@ -1 +1 @@ -./Debug/gui.o ./Debug/main.o ./Debug/AudioOptsDialog.o +./Release/gui.o ./Release/main.o ./Release/AudioOptsDialog.o -- 2.25.1