From: wittend99 Date: Mon, 10 Dec 2012 01:55:45 +0000 (+0000) Subject: git-svn-id: https://svn.code.sf.net/p/freetel/code@1125 01035d8c-6547-0410-b346-abe4f... X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=fb2f4e1ba0a7f7e29cf63fb4ff6dd54f1543daff;p=freetel-svn-tracking.git git-svn-id: https://svn.code.sf.net/p/freetel/code@1125 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2/README.linux b/fdmdv2/README.linux index 58c39967..4ffbc019 100644 --- a/fdmdv2/README.linux +++ b/fdmdv2/README.linux @@ -17,7 +17,7 @@ BUILDING FreeDV for Linux libsamplerate, libsamplerate-dev libsndfile1, libsndfile1-dev -2. Some people have also reported needing libasound (and -lasound in +2. Some people have also reported needing libasound and libasound_dev (and -lasound in the linker line of Makefile.linux) 3. Then build the other libraries below from source. At present the diff --git a/fdmdv2/build/fdmdv2.mk b/fdmdv2/build/fdmdv2.mk index e6ce0125..4f4371c0 100644 --- a/fdmdv2/build/fdmdv2.mk +++ b/fdmdv2/build/fdmdv2.mk @@ -2,18 +2,18 @@ ## Auto Generated makefile by CodeLite IDE ## any manual changes will be erased ## -## Debug +## Release ProjectName :=fdmdv2 -ConfigurationName :=Debug +ConfigurationName :=Release WorkspacePath := "D:\Projects\Radio\fdmdv2\build" ProjectPath := "D:\Projects\Radio\fdmdv2\build" -IntermediateDirectory :=./Debug +IntermediateDirectory :=./Release OutDir := $(IntermediateDirectory) CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=wittend -Date :=12/5/2012 +Date :=12/9/2012 CodeLitePath :="D:\bin\CodeLite" LinkerName :=g++ SharedObjectLinkerName :=g++ -shared -fPIC @@ -28,7 +28,7 @@ LibraryPathSwitch :=-L PreprocessorSwitch :=-D SourceSwitch :=-c OutputFile :=$(IntermediateDirectory)/freeDV -Preprocessors :=$(PreprocessorSwitch)__WX__ +Preprocessors :=$(PreprocessorSwitch)__WX__ $(PreprocessorSwitch)DMW=1 ObjectSwitch :=-o ArchiveOutputSwitch := PreprocessOnlySwitch :=-E @@ -37,12 +37,12 @@ PCHCompileFlags := MakeDirCommand :=makedir RcCmpOptions := $(shell wx-config --rcflags) RcCompilerName :=windres -LinkOptions := -mwindows $(shell wx-config --debug=yes --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/include +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)../../../Audio/portaudio/include $(IncludeSwitch)../../../Audio/libsndfile/include $(IncludeSwitch)../../../Audio/libsamplerate-0.1.8/src IncludePCH := RcIncludePath := Libs := $(LibrarySwitch)sndfile-1 $(LibrarySwitch)codec2 $(LibrarySwitch)portaudio $(LibrarySwitch)portaudiocpp $(LibrarySwitch)samplerate.dll $(LibrarySwitch)ctb-0.16 $(LibrarySwitch)sox -ArLibs := "libsndfile-1.dll" "codec2" "libportaudio.a" "libportaudiocpp.a" "libsamplerate.dll.a" "ctb-0.16.dll" "libsox" +ArLibs := "libsndfile-1.dll" "codec2" "libportaudio.a" "libportaudiocpp.a" "libsamplerate.dll.a" "ctb-0.16.dll" "libsox.a" LibPath := $(LibraryPathSwitch). $(LibraryPathSwitch)d:/Projects/Radio/codec2-dev/src/.libs $(LibraryPathSwitch)d:/bin/MinGW-4.6.1/msys/1.0/local/lib $(LibraryPathSwitch)d:/Projects/Audio/libsndfile/lib ## @@ -52,8 +52,8 @@ LibPath := $(LibraryPathSwitch). $(LibraryPathSwitch)d:/Projects/ AR := ar rcus CXX := g++ CC := gcc -CXXFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1119\" $(Preprocessors) -CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1119\" $(Preprocessors) +CXXFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) -DSVN_REVISION=\"1124\" $(Preprocessors) +CFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) -DSVN_REVISION=\"1124\" $(Preprocessors) ## @@ -65,7 +65,7 @@ PATH:=$(WXWIN)\lib\gcc_dll;$(PATH) WXCFG:=gcc_dll\mswu UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++-1.3 Objects=$(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix) $(IntermediateDirectory)/src_topFrame$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) $(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix) \ - $(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) $(IntermediateDirectory)/src_varicode$(ObjectSuffix) $(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) + $(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) $(IntermediateDirectory)/src_varicode$(ObjectSuffix) $(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) $(IntermediateDirectory)/src_dlg_about$(ObjectSuffix) ## ## Main Build Targets @@ -80,7 +80,7 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) $(IntermediateDirectory)/.d: - @$(MakeDirCommand) "./Debug" + @$(MakeDirCommand) "./Release" PreBuild: @@ -192,6 +192,14 @@ $(IntermediateDirectory)/src_sox_biquad$(DependSuffix): ../src/sox_biquad.c $(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix): ../src/sox_biquad.c @$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/src/sox_biquad.c" +$(IntermediateDirectory)/src_dlg_about$(ObjectSuffix): ../src/dlg_about.cpp $(IntermediateDirectory)/src_dlg_about$(DependSuffix) + $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/dlg_about.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_dlg_about$(ObjectSuffix) $(IncludePath) +$(IntermediateDirectory)/src_dlg_about$(DependSuffix): ../src/dlg_about.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_dlg_about$(ObjectSuffix) -MF$(IntermediateDirectory)/src_dlg_about$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/src/dlg_about.cpp" + +$(IntermediateDirectory)/src_dlg_about$(PreprocessSuffix): ../src/dlg_about.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_dlg_about$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/src/dlg_about.cpp" + -include $(IntermediateDirectory)/*$(DependSuffix) ## @@ -237,8 +245,11 @@ clean: $(RM) $(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) $(RM) $(IntermediateDirectory)/src_sox_biquad$(DependSuffix) $(RM) $(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix) + $(RM) $(IntermediateDirectory)/src_dlg_about$(ObjectSuffix) + $(RM) $(IntermediateDirectory)/src_dlg_about$(DependSuffix) + $(RM) $(IntermediateDirectory)/src_dlg_about$(PreprocessSuffix) $(RM) $(OutputFile) $(RM) $(OutputFile).exe - $(RM) "D:\Projects\Radio\fdmdv2\build\.build-debug\fdmdv2" + $(RM) "D:\Projects\Radio\fdmdv2\build\.build-release\fdmdv2" diff --git a/fdmdv2/build/fdmdv2.project b/fdmdv2/build/fdmdv2.project index bb22eca6..7be8d849 100644 --- a/fdmdv2/build/fdmdv2.project +++ b/fdmdv2/build/fdmdv2.project @@ -21,6 +21,7 @@ + @@ -49,6 +50,8 @@ + + @@ -136,7 +139,7 @@ - + @@ -147,9 +150,7 @@ - - D:\bin\TortiseSVN\bin\svnversion -c D:\Projects\Radio\fdmdv2 - + diff --git a/fdmdv2/build/fdmdv2.txt b/fdmdv2/build/fdmdv2.txt index 1a68a0e7..9090a981 100644 --- a/fdmdv2/build/fdmdv2.txt +++ b/fdmdv2/build/fdmdv2.txt @@ -1 +1 @@ -./Debug/src_dlg_comports.o ./Debug/src_fdmdv2_main.o ./Debug/src_fdmdv2_plot.o ./Debug/src_topFrame.o ./Debug/src_fdmdv2_plot_scatter.o ./Debug/src_fdmdv2_plot_spectrum.o ./Debug/src_fdmdv2_pa_wrapper.o ./Debug/src_fdmdv2_plot_scalar.o ./Debug/src_fdmdv2_plot_waterfall_linux.o ./Debug/src_dlg_audiooptions.o ./Debug/src_dlg_filter.o ./Debug/src_varicode.o ./Debug/src_sox_biquad.o +./Release/src_dlg_comports.o ./Release/src_fdmdv2_main.o ./Release/src_fdmdv2_plot.o ./Release/src_topFrame.o ./Release/src_fdmdv2_plot_scatter.o ./Release/src_fdmdv2_plot_spectrum.o ./Release/src_fdmdv2_pa_wrapper.o ./Release/src_fdmdv2_plot_scalar.o ./Release/src_fdmdv2_plot_waterfall_linux.o ./Release/src_dlg_audiooptions.o ./Release/src_dlg_filter.o ./Release/src_varicode.o ./Release/src_sox_biquad.o ./Release/src_dlg_about.o diff --git a/fdmdv2/build/fdmdv2.workspace b/fdmdv2/build/fdmdv2.workspace index 3d94d014..9052795a 100644 --- a/fdmdv2/build/fdmdv2.workspace +++ b/fdmdv2/build/fdmdv2.workspace @@ -10,7 +10,7 @@ - + diff --git a/fdmdv2/build/fdmdv2_wsp.mk b/fdmdv2/build/fdmdv2_wsp.mk index df903b41..e920a49f 100644 --- a/fdmdv2/build/fdmdv2_wsp.mk +++ b/fdmdv2/build/fdmdv2_wsp.mk @@ -1,8 +1,8 @@ .PHONY: clean All All: - @echo "----------Building project:[ fdmdv2 - Debug ]----------" + @echo "----------Building project:[ fdmdv2 - Release ]----------" @"$(MAKE)" -f "fdmdv2.mk" clean: - @echo "----------Cleaning project:[ fdmdv2 - Debug ]----------" + @echo "----------Cleaning project:[ fdmdv2 - Release ]----------" @"$(MAKE)" -f "fdmdv2.mk" clean diff --git a/fdmdv2/src/Makefile.linux b/fdmdv2/src/Makefile.linux index 9ccc8666..b937adb0 100644 --- a/fdmdv2/src/Makefile.linux +++ b/fdmdv2/src/Makefile.linux @@ -17,12 +17,13 @@ WX_CONFIG=$(WX_GTK_PATH)/wx-config WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags) WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui, adv, net) SVN_REVISION=$(shell svnversion) -FREEDV_VERSION=$(shell cat ../version.txt) +# FREEDV_VERSION=$(shell cat ../version.txt) CODEC2_INC=-I$(CODEC2_PATH)/src CODEC2_LIB=$(CODEC2_PATH)/src/.libs/libcodec2.a SOX_LIB=$(SOX_LIB_PATH)/libsox.a -CPP_FLAGS = $(WX_CPPFLAGS) $(CODEC2_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\" -DFREEDV_VERSION="\"$(FREEDV_VERSION)"\" +#CPP_FLAGS = $(WX_CPPFLAGS) $(CODEC2_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\" -DFREEDV_VERSION="\"$(FREEDV_VERSION)"\" +CPP_FLAGS = $(WX_CPPFLAGS) $(CODEC2_INC) -I. -g -Wall -O3 -DSVN_REVISION=\"$(SVN_REVISION)\" LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lpthread -lsndfile -lsamplerate -Wl,-Bstatic -lctb-0.16 -Wl,-Bdynamic $(SOX_LIB) OBJS = topFrame.o \ @@ -40,7 +41,7 @@ varicode.o \ sox_biquad.o -HDRS = dlg_audiooptions.h dlg_comports.h dlg_filter.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h varicode.h +HDRS = ../version.h dlg_about.h dlg_audiooptions.h dlg_comports.h dlg_filter.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h varicode.h all: freedv diff --git a/fdmdv2/src/Makefile.linux.dmw b/fdmdv2/src/Makefile.linux.dmw index 332d021b..d12ae25b 100644 --- a/fdmdv2/src/Makefile.linux.dmw +++ b/fdmdv2/src/Makefile.linux.dmw @@ -1,22 +1,27 @@ # src/Makefile.linux -# David Rowe 10 Oct 2012 +# David Witten 06 Dec 2012 # -# Makefile for Linux to help David R get up to speed # -# $ make -f Makefile.linux +# $ make -f Makefile.linux.dmw + + +# EDIT THESE FOR YOUR SYSTEM ---------------------------- WX_GTK_PATH=/home/wittend/Projects/wxWidgets-2.9.4/build_gtk CODEC2_PATH=/home/wittend/Projects/codec2-dev +# SOX_LIB_PATH=$(HOME)/sox-14.4.0/src/.libs - not required because I installed soxlib from the repo. + +# END EDITS --------------------------------------------- WX_CONFIG=$(WX_GTK_PATH)/wx-config WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags) WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui) SVN_REVISION=$(shell svnversion) +FREEDV_VERSION=$(shell cat ../version.txt) CODEC2_INC=-I$(CODEC2_PATH)/src CODEC2_LIB=$(CODEC2_PATH)/src/.libs/libcodec2.a -#CPP_FLAGS = $(WX_CPPFLAGS) $(CODEC2_INC) -I../extern/include -g -Wall -CPP_FLAGS = $(WX_CPPFLAGS) $(CODEC2_INC) -I. -g -Wall -O3 -DSVN_REV=\"$(SVN_REVISION)\" +CPP_FLAGS = $(WX_CPPFLAGS) $(CODEC2_INC) -I. -g -Wall -O3 -DSVN_REV=\"$(SVN_REVISION)\" -DFREEDV_VERSION="\"$(FREEDV_VERSION)"\" LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lpthread -lsndfile -lsamplerate OBJS = topFrame.o \ @@ -27,17 +32,19 @@ fdmdv2_plot_scatter.o \ fdmdv2_plot_spectrum.o \ fdmdv2_plot_waterfall_linux.o \ fdmdv2_pa_wrapper.o \ -dlg_about.o \ dlg_audiooptions.o \ dlg_comports.o \ -dlg_options.o +dlg_filter.o \ +varicode.o \ +sox_biquad.o + all: fdmdv2 fdmdv2: $(OBJS) fdmdv2_main.h g++ -o fdmdv2 $(OBJS) $(CPP_FLAGS) $(LIBS) -fdmdv2_main.h: fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h dlg_about.h dlg_audiooptions.h dlg_comports.h dlg_options.h +fdmdv2_main.h: ../version.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h dlg_about.h dlg_audiooptions.h dlg_comports.h dlg_options.h %.o: %.cpp g++ $(CPP_FLAGS) -c $< -o $@ diff --git a/fdmdv2/src/Makefile.win32.dmw b/fdmdv2/src/Makefile.win32.dmw index 86c7fde3..8b968caf 100644 --- a/fdmdv2/src/Makefile.win32.dmw +++ b/fdmdv2/src/Makefile.win32.dmw @@ -1,13 +1,23 @@ # src/Makefile.win32 # David Witten Nov 31 2012 # -# Makefile for Win32 on msys/Mingw to help David # # $ make -f Makefile.Win32.dmw +# EDIT THESE FOR YOUR SYSTEM ---------------------------- + CODEC2_PATH=D:/Projects/Radio/codec2-dev INCLUDE_PATH=d:/bin/MinGW-4.6.1/msys/1.0/local/lib +# not required because I installed soxlib in my: +# D:\bin\MinGW-4.6.1\msys\1.0\local\lib folder +# which is the equivalent from the Msys command line to +# /usr/local/lib under Linux/Unix/BSD type OS's and therefore +# in the default linker path +# SOX_LIB_PATH=$(HOME)/sox-14.4.0/src/.libs + +# END EDITS --------------------------------------------- + WX_CONFIG=wx-config WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags) -D__WXDEBUG__ WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui, adv, net) @@ -15,7 +25,7 @@ SVN_REVISION=$(shell svnversion -c /fdmdv2) CODEC2_INC=$(CODEC2_PATH)/src CODEC2_LIB=$(CODEC2_PATH)/src/.libs/libcodec2.a -CPP_FLAGS = -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -g -Wall -DSVN_REV=\"$(SVN_REVISION)\" +CPP_FLAGS = -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -g -Wall -DSVN_REV=\"$(SVN_REVISION)\" -DFREEDV_VERSION="\"$(FREEDV_VERSION)"\" LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate OBJS = topFrame.o \ @@ -26,12 +36,14 @@ fdmdv2_plot_scatter.o \ fdmdv2_plot_spectrum.o \ fdmdv2_plot_waterfall_linux.o \ fdmdv2_pa_wrapper.o \ -dlg_about.o \ dlg_audiooptions.o \ dlg_comports.o \ -dlg_options.o +dlg_filter.o \ +varicode.o \ +sox_biquad.o + -HDRS = fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h +HDRS = ../version.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h all: freedv @@ -42,5 +54,5 @@ freedv: $(OBJS) g++ $(CPP_FLAGS) -c $< -o $@ clean: - rm -f *.o fdmdv2 + rm -f *.o FreeDV.exe diff --git a/fdmdv2/src/dlg_about.cpp b/fdmdv2/src/dlg_about.cpp new file mode 100644 index 00000000..0d1acc00 --- /dev/null +++ b/fdmdv2/src/dlg_about.cpp @@ -0,0 +1,225 @@ +//========================================================================== +// Name: dlg_about.cpp +// Purpose: Creates simple about dialog. +// Date: Dec 06 2012 +// Authors: David Rowe, David Witten +// +// License: +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2.1, +// as published by the Free Software Foundation. This program is +// distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, see . +// +//========================================================================== +#include +#include +#include "dlg_about.h" +//#include "contributers.h" + +AboutDlg::AboutDlg( wxWindow* parent, + wxWindowID id, + const wxString& title, + const wxPoint& pos, + const wxSize& size, + long style) : wxDialog(parent, id, title, pos, size, style) +{ + this->SetSizeHints(wxDefaultSize, wxDefaultSize); + + wxBoxSizer* mainSizer; + mainSizer = new wxBoxSizer(wxVERTICAL); + + m_notebook1 = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); + m_panel1 = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); + wxBoxSizer* bSizer3; + bSizer3 = new wxBoxSizer(wxVERTICAL); + +// m_bitmap = new wxStaticBitmap(m_panel1, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0); +// bSizer3->Add(m_bitmap, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5); + + m_panel1->SetSizer(bSizer3); + m_panel1->Layout(); + bSizer3->Fit(m_panel1); + m_notebook1->AddPage(m_panel1, _("About"), true); + m_panel4 = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); + wxBoxSizer* bSizer4; + bSizer4 = new wxBoxSizer(wxVERTICAL); + + m_htmlWin3 = new wxHtmlWindow(m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO); + bSizer4->Add(m_htmlWin3, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5); + + m_panel4->SetSizer(bSizer4); + m_panel4->Layout(); + bSizer4->Fit(m_panel4); + m_notebook1->AddPage(m_panel4, _("Credits"), false); + m_panel3 = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); + wxBoxSizer* bSizer5; + bSizer5 = new wxBoxSizer(wxVERTICAL); + + m_textCtrlLicense = new wxTextCtrl(m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_DONTWRAP|wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH2); + bSizer5->Add(m_textCtrlLicense, 1, wxEXPAND, 5); + + m_panel3->SetSizer(bSizer5); + m_panel3->Layout(); + bSizer5->Fit(m_panel3); + m_notebook1->AddPage(m_panel3, _("License"), false); + + mainSizer->Add(m_notebook1, 1, wxEXPAND | wxALL, 5); + + wxStaticBoxSizer* sbSizer1; + sbSizer1 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, wxEmptyString), wxVERTICAL); + + wxFlexGridSizer* fgSizer1; + fgSizer1 = new wxFlexGridSizer(0, 2, 0, 0); + fgSizer1->SetFlexibleDirection(wxBOTH); + fgSizer1->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED); + + m_staticTextHomePage = new wxStaticText(this, wxID_ANY, _("Home Page:"), wxDefaultPosition, wxDefaultSize, 0); + m_staticTextHomePage->Wrap(-1); + m_staticTextHomePage->SetFont(wxFont(wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString)); + + fgSizer1->Add(m_staticTextHomePage, 1, wxALL|wxEXPAND, 5); + + m_hyperlink1 = new wxHyperlinkCtrl(this, wxID_ANY, _("http://freedv.org"), wxT("http://freedv.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + fgSizer1->Add(m_hyperlink1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); + + m_staticText2 = new wxStaticText(this, wxID_ANY, _("freedv Forum:"), wxDefaultPosition, wxDefaultSize, 0); + m_staticText2->Wrap(-1); + m_staticText2->SetFont(wxFont(wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString)); + + fgSizer1->Add(m_staticText2, 0, wxALL, 5); + + m_hyperlink2 = new wxHyperlinkCtrl(this, wxID_ANY, _("Google Group"), wxT("https://groups.google.com/forum/?fromgroups=#!forum/digitalvoice"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + fgSizer1->Add(m_hyperlink2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); + + m_staticText3 = new wxStaticText(this, wxID_ANY, _("Version:"), wxDefaultPosition, wxDefaultSize, 0); + m_staticText3->Wrap(-1); + m_staticText3->SetFont(wxFont(wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString)); + + fgSizer1->Add(m_staticText3, 0, wxALL, 5); + + m_staticTextInformation = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); + m_staticTextInformation->Wrap(-1); + fgSizer1->Add(m_staticTextInformation, 0, wxALL, 5); + +// m_bitmapPayPal = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0); +// fgSizer1->Add(m_bitmapPayPal, 0, wxALL, 5); + + m_hyperlink3 = new wxHyperlinkCtrl(this, wxID_ANY, _("Donate via PayPal"), wxT("https://sourceforge.net/donate/index.php?group_id=202033"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); + fgSizer1->Add(m_hyperlink3, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); + + sbSizer1->Add(fgSizer1, 1, wxEXPAND, 5); + + mainSizer->Add(sbSizer1, 0, wxEXPAND|wxALL, 5); + + wxBoxSizer* buttonSizer; + buttonSizer = new wxBoxSizer(wxHORIZONTAL); + + m_buttonOk = new wxButton(this, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0); + m_buttonOk->SetDefault(); + buttonSizer->Add(m_buttonOk, 0, wxALL, 5); + + mainSizer->Add(buttonSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5); + + this->SetSizer(mainSizer); + this->Layout(); + mainSizer->Fit(this); + this->Centre(wxBOTH); + wxString svnLatestRev("Can't determine latest SVN revision."); + + // Try to determine current SVN revision from the Internet + wxURL url(wxT("http://freetel.svn.sourceforge.net/svnroot/freetel/fdmdv2/")); + + if(url.GetError() == wxURL_NOERR) + { + wxString htmldata; + wxInputStream *in = url.GetInputStream(); + + if(in && in->IsOk()) + { + //printf("In OK\n"); + wxStringOutputStream html_stream(&htmldata); + in->Read(html_stream); + //wxLogDebug(htmldata); + + wxString s("

freetel - Revision "); + int startIndex = htmldata.find(s) + s.Length(); + int endIndex = htmldata.find(wxT(": /fdmdv2

")); + svnLatestRev = wxT("Latest svn revision: ") + htmldata.SubString(startIndex, endIndex-1); + //printf("startIndex: %d endIndex: %d\n", startIndex, endIndex); + } + delete in; + } + + wxString msg; + msg.Printf( wxT("FreeDV %s\n\n") + wxT("Open Source Narrow Band Digital Voice over Radio\n\n") + wxT("For Help and Support visit: http://freedv.org\n\n") + wxT("GNU Public License V2.1\n\n") + wxT("Copyright (c) David Witten KD0EAG and David Rowe VK5DGR\n\n") + wxT("svn revision: %s\n") + svnLatestRev, FREEDV_VERSION, SVN_REVISION); + +// wxMessageBox(msg, wxT("About"), wxOK | wxICON_INFORMATION, this); +} + +AboutDlg::~AboutDlg() +{ +} +/* +AboutDlg::AboutDlg(wxWindow* parent, const wxString &mainTitle) : AboutDlgBase(parent) +{ + wxFileName splashscreen(ManagerST::Get()->GetStarupDirectory() + + wxFileName::GetPathSeparator() + + wxT("images") + + wxFileName::GetPathSeparator() + + wxT("splashscreen.png")); + + m_bmp.LoadFile(splashscreen.GetFullPath(), wxBITMAP_TYPE_PNG); + m_bitmap->SetBitmap(m_bmp); + GetSizer()->Fit(this); + + BitmapLoader bmpLoader; + m_bitmapPayPal->SetBitmap(bmpLoader.LoadBitmap(wxT("about/32/paypal"))); + + // set the page content + m_htmlWin3->SetPage(wxString::FromUTF8(about_hex)); + m_buttonOk->SetFocus(); + + wxFileName license(ManagerST::Get()->GetInstallDir() + wxFileName::GetPathSeparator() + wxT("LICENSE")); + wxString licenseFullname = license.GetFullPath(); + if(license.FileExists()) + { + wxFFile fp(licenseFullname); + if(fp.IsOpened()) + { + wxString content; + fp.ReadAll(&content, wxConvUTF8); + fp.Close(); + + m_textCtrlLicense->SetEditable(true); + wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); + font.SetFamily(wxFONTFAMILY_TELETYPE); + m_textCtrlLicense->SetFont(font); + + m_textCtrlLicense->ChangeValue(content); + m_textCtrlLicense->SetEditable(false); + } + } + CentreOnScreen(); +} + +AboutDlg::~AboutDlg() +{ +} +*/ + +void AboutDlg::ExchangeData(int inout) +{ +// return m_staticTextInformation->GetLabelText(); +} diff --git a/fdmdv2/src/dlg_about.h b/fdmdv2/src/dlg_about.h new file mode 100644 index 00000000..ffdc12cc --- /dev/null +++ b/fdmdv2/src/dlg_about.h @@ -0,0 +1,72 @@ +//========================================================================== +// Name: dlg_about.h +// Purpose: Provides an 'about' dialog. +// Created: Dec 06, 2012 +// Authors: David Rowe, David Witten +// +// License: +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2.1, +// as published by the Free Software Foundation. This program is +// distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, see . +// +//========================================================================== +#ifndef __AboutDlg__ +#define __AboutDlg__ + +#include "fdmdv2_main.h" +#include "wx/bitmap.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** Implementing AboutDlg */ +class AboutDlg : public wxDialog +{ + protected: + wxNotebook* m_notebook1; + wxPanel* m_panel1; + wxStaticBitmap* m_bitmap; + wxPanel* m_panel4; + wxHtmlWindow* m_htmlWin3; + wxPanel* m_panel3; + wxTextCtrl* m_textCtrlLicense; + wxStaticText* m_staticTextHomePage; + wxHyperlinkCtrl* m_hyperlink1; + wxStaticText* m_staticText2; + wxHyperlinkCtrl* m_hyperlink2; + wxStaticText* m_staticText3; + wxStaticText* m_staticTextInformation; + wxStaticBitmap* m_bitmapPayPal; + wxHyperlinkCtrl* m_hyperlink3; + wxButton* m_buttonOk; + wxBitmap m_bmp; + + public: + /** Constructor */ + AboutDlg( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About freeDV"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + virtual ~AboutDlg(); + void ExchangeData(int inout); +}; + +#endif // __AboutDlg__ diff --git a/fdmdv2/src/fdmdv2_main.cpp b/fdmdv2/src/fdmdv2_main.cpp index 1cfff3fe..23c25662 100644 --- a/fdmdv2/src/fdmdv2_main.cpp +++ b/fdmdv2/src/fdmdv2_main.cpp @@ -894,10 +894,16 @@ void MainFrame::OnTogBtnTXClick(wxCommandEvent& event) else { // rx-> tx transition, swap to Mic In page to monitor speech - wxGetApp().m_rxNbookCtrl = m_auiNbookCtrl->GetSelection(); - m_auiNbookCtrl->ChangeSelection(4); // is there a way to avoid hard coding this? - +// m_auiNbookCtrl->ChangeSelection(4); // is there a way to avoid hard coding this? +// +// David: I think int GetPageIndex (wxWindow *page_wnd) const +// might help. Something like: +// size_t idx = GetPageIndex(wxWindow *page_wnd); +// m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn)); +// -- dmw +// + m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn)); } g_tx = m_btnTogPTT->GetValue(); // Tortured and tortuous logic, it seems to me... @@ -1483,6 +1489,17 @@ void MainFrame::OnHelpCheckUpdatesUI(wxUpdateUIEvent& event) //------------------------------------------------------------------------- void MainFrame::OnHelpAbout(wxCommandEvent& event) { + wxUnusedVar(event); +#ifdef _USE_ABOUT_DIALOG + int rv = 0; + AboutDlg *dlg = new AboutDlg(NULL); + rv = dlg->ShowModal(); + if(rv == wxID_OK) + { + dlg->ExchangeData(EXCHANGE_DATA_OUT); + } + delete dlg; +#else wxString svnLatestRev("Can't determine latest SVN revision."); // Try to determine current SVN revision from the Internet @@ -1519,9 +1536,10 @@ void MainFrame::OnHelpAbout(wxCommandEvent& event) wxMessageBox(msg, wxT("About"), wxOK | wxICON_INFORMATION, this); - +#endif // _USE_ABOUT_DIALOG } +//bool wxLaunchDefaultBrowser(http:("http://freedv.org/"); //------------------------------------------------------------------------- // OnTogBtnOnOff() diff --git a/fdmdv2/src/fdmdv2_main.h b/fdmdv2/src/fdmdv2_main.h index 8de702ae..3ed7acf9 100644 --- a/fdmdv2/src/fdmdv2_main.h +++ b/fdmdv2/src/fdmdv2_main.h @@ -22,11 +22,12 @@ #ifndef __FDMDV2_MAIN__ #define __FDMDV2_MAIN__ +#include "../version.h" #include #include #include -#include +//#include #include "wx/rawbmp.h" #include "wx/file.h" #include "wx/filename.h" @@ -68,6 +69,7 @@ #include "portaudio.h" #include "dlg_audiooptions.h" #include "dlg_filter.h" +#include "dlg_about.h" #include "varicode.h" #include "sox_biquad.h" @@ -76,6 +78,7 @@ #define _DUMMY_DATA 1 //#define _AUDIO_PASSTHROUGH 1 #define _REFRESH_TIMER_PERIOD (DT*1000) +//#define _USE_ABOUT_DIALOG 1 enum { ID_START = wxID_HIGHEST, diff --git a/fdmdv2/src/topFrame.h b/fdmdv2/src/topFrame.h index 2df715f6..5fe0c242 100644 --- a/fdmdv2/src/topFrame.h +++ b/fdmdv2/src/topFrame.h @@ -26,6 +26,7 @@ // #define SVN_REV SVN_REVISION //#endif +#include "../version.h" #include #include #include @@ -158,7 +159,7 @@ class TopFrame : public wxFrame wxAuiNotebook* m_auiNbookCtrl; - TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV " FREEDV_VERSION), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 761,500 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL ); + TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV ") + _(FREEDV_VERSION), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 761,500 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL ); ~TopFrame(); diff --git a/fdmdv2/version.h b/fdmdv2/version.h new file mode 100644 index 00000000..dc3f8222 --- /dev/null +++ b/fdmdv2/version.h @@ -0,0 +1,6 @@ +#ifndef FREEDV_VER_DOT_H +#define FREEDV_VER_DOT_H 1 + +#define FREEDV_VERSION "0.9 Beta" + +#endif //FREEDV_VER_DOT_H \ No newline at end of file